xash93d/webpack.config.js
2022-10-28 02:48:42 -06:00

47 lines
1.1 KiB
JavaScript
Executable File

const path = require('path'),
merge = require('./util/merge')
let env = /^--([a-z]+)$/i.exec(process.argv[2])
env = env ? env[1] : 'dev'
const config = {
entry: path.join(__dirname, 'src/index.js'),
output: {
// path: path.join(__dirname, 'dist/'),
path: path.join(__dirname, 'view/dist'),
filename: 'xash.js'
},
// module: {
// rules: [
// {
// test: /\.m?js$/i,
// exclude: /node_modules|bower_components/,
// use: {
// loader: 'babel-loader',
// options: {
// sourceType: 'unambiguous',
// presets: [
// '@babel/preset-env'
// ],
// plugins: [
// // '@babel/plugin-transform-runtime',
// // '@babel/plugin-proposal-class-properties'
// '@babel/plugin-syntax-dynamic-import'
// ]
// }
// }
// }
// ]
// }
}
const environments = {
'dev': {
mode: 'development'
},
'prod': {
mode: 'production'
}
}
module.exports = merge(config, environments[env])