Настройка сборки webpack
This commit is contained in:
@@ -35,7 +35,6 @@
|
||||
"node/no-missing-require": "error",
|
||||
"node/no-unpublished-bin": "error",
|
||||
"node/no-unpublished-import": "off",
|
||||
"node/no-unpublished-require": "error",
|
||||
"node/no-unsupported-features/es-builtins": "error",
|
||||
"node/no-unsupported-features/es-syntax": "error",
|
||||
"node/no-unsupported-features/node-builtins": "error",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"ignore": ["node_modules", ".git", "client/**/*.*"],
|
||||
|
||||
"__exec": "node server"
|
||||
"ext": "js json"
|
||||
}
|
||||
3984
package-lock.json
generated
3984
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@@ -4,29 +4,44 @@
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nodemon --inspect server",
|
||||
"build:client": "webpack --config build/webpack.prod.config.js",
|
||||
"build:linux": "npm run build:client && pkg -t latest-linux-x64 -o dist/linux/liberama .",
|
||||
"build:win": "npm run build:client && pkg -t latest-win-x64 -o dist/win/liberama .",
|
||||
"lint": "eslint --ext=.js,.vue client server"
|
||||
},
|
||||
"bin": "server/index.js",
|
||||
"pkg": {
|
||||
"scripts": "server/config/*.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^7.2.2",
|
||||
"eslint": "^5.4.0",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"css-loader": "^1.0.0",
|
||||
"eslint": "^5.11.1",
|
||||
"eslint-plugin-html": "^1.4.0",
|
||||
"eslint-plugin-node": "^8.0.0",
|
||||
"eslint-plugin-vue": "^5.0.0",
|
||||
"pkg": "^4.3.5"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --ext=.js,.vue client server",
|
||||
"build:linux": "pkg -t latest-linux-x64 -o dist/linux/liberama .",
|
||||
"build:win": "pkg -t latest-win-x64 -o dist/win/liberama .",
|
||||
"start": "node server/index.js"
|
||||
"file-loader": "^3.0.1",
|
||||
"pkg": "^4.3.5",
|
||||
"url-loader": "^1.1.2",
|
||||
"vue-loader": "^15.4.2",
|
||||
"vue-style-loader": "^4.1.2",
|
||||
"vue-template-compiler": "^2.5.21",
|
||||
"webpack": "^4.28.2",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-dev-middleware": "^3.4.0",
|
||||
"webpack-hot-middleware": "^2.24.3",
|
||||
"webpack-merge": "^4.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"bluebird": "^3.5.3",
|
||||
"express": "^4.16.4",
|
||||
"lazy.js": "^0.5.1",
|
||||
"sql-template-strings": "^2.2.2",
|
||||
"sqlite": "^3.0.0"
|
||||
"sqlite": "^3.0.0",
|
||||
"vue": "^2.5.21"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,23 @@ async function main() {
|
||||
log('Opening database');
|
||||
await connPool.init();
|
||||
|
||||
if (config.branch == 'development') {
|
||||
const webpack = require('webpack');
|
||||
const wpConfig = require('../build/webpack.dev.config');
|
||||
|
||||
const compiler = webpack(wpConfig);
|
||||
const devMiddleware = require('webpack-dev-middleware');
|
||||
app.use(devMiddleware(compiler, {
|
||||
publicPath: wpConfig.output.publicPath,
|
||||
stats: {colors: true}
|
||||
}));
|
||||
|
||||
let hotMiddleware = require('webpack-hot-middleware');
|
||||
app.use(hotMiddleware(compiler, {
|
||||
log: log
|
||||
}));
|
||||
}
|
||||
|
||||
app.use(express.static('public'));
|
||||
app.use(express.json());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user