feat(build-chain): set up and updated deps
This commit is contained in:
parent
84b4ff019f
commit
a61ac620a2
61
config/webpack.base.js
Normal file
61
config/webpack.base.js
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
const webpack = require("webpack");
|
||||||
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
|
const CopyPlugin = require('copy-webpack-plugin');
|
||||||
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
entry: {
|
||||||
|
main: ["./src/js/index.js"],
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
path: path.join(__dirname, "..", "public"),
|
||||||
|
filename: "[name]-[hash].js"
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
extensions: ["*", ".json", ".js"]
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.(js)$/,
|
||||||
|
exclude: /node_modules/,
|
||||||
|
loader: "babel-loader",
|
||||||
|
options: {
|
||||||
|
compact: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: ['style-loader', 'css-loader']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(png|jpe?g|gif)$/i,
|
||||||
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'file-loader',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new CleanWebpackPlugin(),
|
||||||
|
new webpack.ProvidePlugin({
|
||||||
|
$: 'jquery',
|
||||||
|
jQuery: 'jquery',
|
||||||
|
"window.jQuery": "jquery",
|
||||||
|
"window.$": "jquery",
|
||||||
|
}),
|
||||||
|
new CopyPlugin([
|
||||||
|
{ from: 'assets', to: '' },
|
||||||
|
]),
|
||||||
|
new HtmlWebpackPlugin({
|
||||||
|
template: 'src/index.html',
|
||||||
|
minify: false,
|
||||||
|
inject: true
|
||||||
|
})
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = config;
|
11
config/webpack.build.js
Normal file
11
config/webpack.build.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
const merge = require("webpack-merge");
|
||||||
|
const baseConfig = require("./webpack.base");
|
||||||
|
|
||||||
|
module.exports = merge(baseConfig, {
|
||||||
|
mode: "production",
|
||||||
|
optimization: {
|
||||||
|
minimize: true,
|
||||||
|
nodeEnv: "production",
|
||||||
|
},
|
||||||
|
devtool: false
|
||||||
|
});
|
18
config/webpack.dev.js
Normal file
18
config/webpack.dev.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
const merge = require("webpack-merge");
|
||||||
|
const baseConfig = require("./webpack.base");
|
||||||
|
const webpack = require("webpack");
|
||||||
|
|
||||||
|
const devConfig = merge(baseConfig, {
|
||||||
|
mode: "development",
|
||||||
|
devtool: "eval-source-map",
|
||||||
|
optimization: {
|
||||||
|
minimize: false,
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
|
new webpack.NamedModulesPlugin(),
|
||||||
|
new webpack.NoEmitOnErrorsPlugin(), // don't reload if there is an error
|
||||||
|
].concat(baseConfig.plugins),
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = devConfig;
|
7933
package-lock.json
generated
7933
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
55
package.json
55
package.json
@ -5,8 +5,11 @@
|
|||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"directories": {},
|
"directories": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"No tests needed!\" && exit 1",
|
"build": "webpack --config config/webpack.build.js",
|
||||||
"start": "node server.js"
|
"start:dev": "node scripts/server.js --mode=development",
|
||||||
|
"start:prod": "npm run build && npm run start:prod-no-build",
|
||||||
|
"start:prod-no-build": "node scripts/server.js --mode=production",
|
||||||
|
"test": "echo \"No tests needed!\" && exit 1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -26,6 +29,52 @@
|
|||||||
"socket.io": "2.*",
|
"socket.io": "2.*",
|
||||||
"webdav": "^2.8.0"
|
"webdav": "^2.8.0"
|
||||||
},
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/cli": "^7.8.4",
|
||||||
|
"@babel/core": "^7.9.0",
|
||||||
|
"@babel/plugin-proposal-class-properties": "^7.8.3",
|
||||||
|
"@babel/polyfill": "^7.8.7",
|
||||||
|
"@babel/preset-env": "^7.9.5",
|
||||||
|
"@fortawesome/fontawesome-free": "^5.8.1",
|
||||||
|
"babel-loader": "^8.1.0",
|
||||||
|
"babel-preset-minify": "^0.5.0",
|
||||||
|
"clean-webpack-plugin": "3.0.0",
|
||||||
|
"copy-webpack-plugin": "5.1.1",
|
||||||
|
"css-loader": "3.5.2",
|
||||||
|
"html-webpack-plugin": "4.2.0",
|
||||||
|
"jquery": "^3.2.1",
|
||||||
|
"jquery-ui": "^1.12.1",
|
||||||
|
"keymage": "^1.1.3",
|
||||||
|
"style-loader": "1.1.4",
|
||||||
|
"vanilla-picker": "2.10.1",
|
||||||
|
"webpack": "^4.42.1",
|
||||||
|
"webpack-cli": "^3.3.11",
|
||||||
|
"webpack-dev-server": "^3.10.3",
|
||||||
|
"webpack-merge": "^4.2.2"
|
||||||
|
},
|
||||||
"author": "Cracker0dks",
|
"author": "Cracker0dks",
|
||||||
"license": "MIT"
|
"license": "MIT",
|
||||||
|
"private": true,
|
||||||
|
"browserslist": {
|
||||||
|
"production": [
|
||||||
|
">0.2%",
|
||||||
|
"not dead",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"development": [
|
||||||
|
"last 1 chrome version",
|
||||||
|
"last 1 firefox version",
|
||||||
|
"last 1 safari version"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"babel": {
|
||||||
|
"presets": [
|
||||||
|
"@babel/preset-env"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"@babel/plugin-proposal-class-properties"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user