minor on webpack configuration and add build script

This commit is contained in:
lesion 2021-11-19 17:55:12 +01:00
parent 2c944faff3
commit c0b11c7218
2 changed files with 16 additions and 17 deletions

View file

@ -13,7 +13,8 @@
"scripts": {
"test": "npm run test:node && npm run test:browser",
"test:node": "mocha",
"test:browser": "karma start --single-run --browsers ChromeHeadless,FirefoxHeadless karma.config.js"
"test:browser": "karma start --single-run --browsers ChromeHeadless,FirefoxHeadless karma.config.js",
"build": "webpack"
},
"author": "",
"license": "ISC",

View file

@ -1,17 +1,15 @@
const path = require('path');
const path = require('path')
module.exports = []
for(let target of ['web', 'node']) {
var conf = {
name: target,
entry: './radiomanifest.js',
target: [target],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'radiomanifest-' + target + '.bundle.js',
clean: false,
},
}
module.exports.push(conf)
}
console.log(module.exports)
module.exports = ['web', 'node'].map(
target => ({
name: target,
mode: 'production',
entry: './radiomanifest.js',
target: [target],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'radiomanifest-' + target + '.bundle.js',
clean: false
}
})
)