mirror of
https://github.com/AlecM33/Werewolf.git
synced 2026-01-02 01:03:24 +01:00
webpack
This commit is contained in:
33
client/webpack/webpack-dev.config.js
Normal file
33
client/webpack/webpack-dev.config.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
game: './client/src/scripts/game.js',
|
||||
home: './client/src/scripts/home.js',
|
||||
create: './client/src/scripts/create.js'
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../dist'),
|
||||
filename: "[name]-bundle.js"
|
||||
},
|
||||
mode: "development",
|
||||
node: false,
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.m?js$/,
|
||||
use: {
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
presets: ["@babel/preset-env"], // ensure compatibility with older browsers
|
||||
plugins: ["@babel/plugin-transform-object-assign"], // ensure compatibility with IE 11
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: "webpack-remove-debug", // remove "debug" package
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
34
client/webpack/webpack-prod.config.js
Normal file
34
client/webpack/webpack-prod.config.js
Normal file
@@ -0,0 +1,34 @@
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
game: './client/src/scripts/game.js',
|
||||
home: './client/src/scripts/home.js',
|
||||
create: './client/src/scripts/create.js'
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, '../dist'),
|
||||
filename: "[name]-bundle.js"
|
||||
},
|
||||
mode: "production",
|
||||
node: false,
|
||||
devtool: 'source-map',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.m?js$/,
|
||||
use: {
|
||||
loader: "babel-loader",
|
||||
options: {
|
||||
presets: ["@babel/preset-env"], // ensure compatibility with older browsers
|
||||
plugins: ["@babel/plugin-transform-object-assign"], // ensure compatibility with IE 11
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: "webpack-remove-debug", // remove "debug" package
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user