Reconfigured webpack to also have a development build.
This commit is contained in:
parent
ef36e398b5
commit
c0b324fba6
2
.eslintignore
Normal file
2
.eslintignore
Normal file
@ -0,0 +1,2 @@
|
||||
webpack.*.js
|
||||
webpack.*.cjs
|
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -11,7 +11,7 @@ pipeline {
|
||||
stage("build") {
|
||||
steps {
|
||||
nodejs('NodeJS (17.4.0)') {
|
||||
sh "npm run build"
|
||||
sh "npm run build:dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
3236
package-lock.json
generated
3236
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,9 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "webpack --config webpack.config.js",
|
||||
"build:prod": "webpack --config webpack.prod.cjs",
|
||||
"build:dev": "webpack --config webpack.dev.cjs",
|
||||
"build": "webpack --config webpack.dev.cjs",
|
||||
"test": "mocha tests/** --reporter mocha-junit-reporter --reporter-options mochaFile=./junit/test_results.xml",
|
||||
"docs": "jsdoc src README.md -r -d docs -c jsdoc.config.json"
|
||||
},
|
||||
@ -22,14 +24,12 @@
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsdoc": "^39.2.1",
|
||||
"html-loader": "^3.1.0",
|
||||
"jsdoc": "^3.6.10",
|
||||
"mocha": "^9.2.2",
|
||||
"mocha-junit-reporter": "^2.0.2",
|
||||
"style-loader": "^3.3.1",
|
||||
"webpack": "^5.72.0",
|
||||
"webpack-cli": "^4.9.2",
|
||||
"webpack-dev-server": "^4.8.1",
|
||||
"webpack-merge": "^5.8.0"
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
import path from "path";
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
|
||||
export default {
|
||||
mode: "production",
|
||||
entry: {
|
||||
audioshowkit: path.resolve("./src/audioshowkitlib.js"),
|
||||
},
|
||||
@ -26,9 +26,7 @@ export default {
|
||||
output: {
|
||||
filename: "[name].js",
|
||||
path: path.resolve("./dist"),
|
||||
library: ["[name]"]
|
||||
library: ["[name]"],
|
||||
clean: true
|
||||
},
|
||||
plugins: [
|
||||
|
||||
]
|
||||
};
|
11
webpack.dev.cjs
Normal file
11
webpack.dev.cjs
Normal file
@ -0,0 +1,11 @@
|
||||
const path = require("path");
|
||||
const { merge } = require("webpack-merge");
|
||||
const webpackCommon = require("./webpack.common.cjs");
|
||||
|
||||
|
||||
const devConfig = {
|
||||
mode: "development",
|
||||
devtool: "eval-source-map",
|
||||
};
|
||||
|
||||
module.exports = merge(webpackCommon, devConfig);
|
9
webpack.prod.cjs
Normal file
9
webpack.prod.cjs
Normal file
@ -0,0 +1,9 @@
|
||||
const { merge } = require("webpack-merge");
|
||||
const webpackCommon = require("./webpack.common.cjs");
|
||||
|
||||
|
||||
const prodConfig = {
|
||||
mode: "production",
|
||||
};
|
||||
|
||||
module.exports = merge(webpackCommon, prodConfig);
|
Loading…
Reference in New Issue
Block a user