Jean-Yves Didier

bundler test for arcsapp components

...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
40 "devDependencies": { 40 "devDependencies": {
41 "copy-webpack-plugin": "^9.0.1", 41 "copy-webpack-plugin": "^9.0.1",
42 "eslint-webpack-plugin": "^3.0.1", 42 "eslint-webpack-plugin": "^3.0.1",
43 - "jsdoc-webpack-plugin": "^0.3.0" 43 + "jsdoc-webpack-plugin": "^0.3.0",
44 + "val-loader": "^4.0.0"
44 } 45 }
45 } 46 }
......
1 +/** The aim of this part is to provide a bundler for the arcsapp so that less files are downloaded at runtime
2 + *
3 + */
4 +
5 +module.exports = function arcsappToJs(options, loaderContext, content) {
6 + // content is here our file arcsapp.json
7 +
8 +
9 + let code = `let descr=${content};`
10 +
11 + return {
12 + cacheable : true,
13 + code : code
14 + };
15 +
16 +};
17 +
18 +
1 +const path=require('path');
2 +
3 +
4 +module.exports = {
5 + entry : './arcsapp.json',
6 + mode: "none",
7 +
8 + output: {
9 + path: path.resolve(__dirname, ''),
10 + filename: "toto.js"
11 + },
12 + module: {
13 + rules: [
14 + {
15 + test: /arcsapp\.json$/,
16 + rules: [{
17 + loader: "val-loader",
18 + options: {
19 + executableFile: path.resolve( __dirname, "../../src", "arcsapp_bundler.js")
20 + }
21 + }]
22 + },
23 + {
24 + test: /arcsapp\.json$/,
25 + //type: "asset/inline"
26 + type: "javascript/auto"
27 + }
28 + ]
29 + }
30 +
31 +};