Jean-Yves Didier

multiple target for webpack

This diff is collapsed. Click to expand it.
......@@ -3,7 +3,9 @@ const jsdoc = require('jsdoc-webpack-plugin');
const copy = require('copy-webpack-plugin');
const eslint = require('eslint-webpack-plugin');
module.exports = {
module.exports = [
{
name: "core",
experiments : {
outputModule: true
},
......@@ -28,6 +30,46 @@ module.exports = {
}
},
plugins: [
new eslint({}),
new copy({
patterns: [
{ from :'src/arcs_browser.js', to: 'arcs_browser.js'},
{ from: 'src/arcs_node.mjs', to: 'arcs_node.mjs'}
]
})
]
},
{
name: "core-min",
experiments : {
outputModule: true
},
entry: {
'arcs' : {
import : './src/exports.js',
},
},
mode: 'production',
output: {
filename: '[name].min.js',
path: path.resolve(__dirname, 'build'),
library: {
type: 'module',
}
},
module: {
parser: {
javascript: {
commonjsMagicComments: true
}
}
},
},
{
name: "doc",
mode: "development",
entry: {},
plugins: [
new jsdoc({
conf: 'docs/engine.conf.json',
destination: 'docs/engine',
......@@ -38,10 +80,15 @@ module.exports = {
destination: 'docs/components',
template: 'docs/arcs',
}),
]
},
{
name: "deps",
mode: "production",
entry: {},
plugins: [
new copy({
patterns: [
{ from :'src/arcs_browser.js', to: 'arcs_browser.js'},
{ from: 'src/arcs_node.mjs', to: 'arcs_node.mjs'},
{ from: 'node_modules/tracking/build/tracking.js', to: '../deps/tracking/tracking.js'},
{ from: 'node_modules/three/build/three.module.js', to: '../deps/three.js/index.js'},
{
......@@ -108,9 +155,9 @@ module.exports = {
// can also prepend content and replace strings using the transform property!
]
}),
new eslint({})
]
};
}
];
......