mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-11 06:36:05 +00:00
add some comments
This commit is contained in:
parent
8f034bc078
commit
99ca230bdb
@ -49,13 +49,23 @@ fn project() -> Project {
|
|||||||
r#"
|
r#"
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
|
||||||
let nodeModules = {};
|
let nodeModules = {};
|
||||||
fs.readdirSync('node_modules').filter(function(x) {
|
|
||||||
return ['.bin'].indexOf(x) === -1;
|
// Webpack bundles the modules from node_modules.
|
||||||
}).forEach(function(mod) {
|
// For node target, we will not have `fs` module
|
||||||
nodeModules[mod] = 'commonjs ' + mod;
|
// inside the `node_modules` folder.
|
||||||
});
|
// This reads the directories in `node_modules`
|
||||||
|
// and give that to externals and webpack ignores
|
||||||
|
// to bundle the modules listed as external.
|
||||||
|
fs.readdirSync('node_modules')
|
||||||
|
.filter(module => ['.bin'].indexOf(module) === -1)
|
||||||
|
.forEach(mod => {
|
||||||
|
// External however,expects browser environment.
|
||||||
|
// To make it work in `node` target we
|
||||||
|
// prefix commonjs here.
|
||||||
|
nodeModules[mod] = 'commonjs ' + mod;
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: './run.js',
|
entry: './run.js',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user