Jean-Yves Didier

bundler test for arcsapp components

......@@ -40,6 +40,7 @@
"devDependencies": {
"copy-webpack-plugin": "^9.0.1",
"eslint-webpack-plugin": "^3.0.1",
"jsdoc-webpack-plugin": "^0.3.0"
"jsdoc-webpack-plugin": "^0.3.0",
"val-loader": "^4.0.0"
}
}
......
/** The aim of this part is to provide a bundler for the arcsapp so that less files are downloaded at runtime
*
*/
module.exports = function arcsappToJs(options, loaderContext, content) {
// content is here our file arcsapp.json
let code = `let descr=${content};`
return {
cacheable : true,
code : code
};
};
const path=require('path');
module.exports = {
entry : './arcsapp.json',
mode: "none",
output: {
path: path.resolve(__dirname, ''),
filename: "toto.js"
},
module: {
rules: [
{
test: /arcsapp\.json$/,
rules: [{
loader: "val-loader",
options: {
executableFile: path.resolve( __dirname, "../../src", "arcsapp_bundler.js")
}
}]
},
{
test: /arcsapp\.json$/,
//type: "asset/inline"
type: "javascript/auto"
}
]
}
};