2020-07-03 16:30:46 +08:00
|
|
|
import * as webpack from 'webpack'
|
|
|
|
|
2020-06-11 19:27:15 +08:00
|
|
|
const devMode = !process.argv.includes('-p')
|
|
|
|
|
2020-07-03 16:30:46 +08:00
|
|
|
const config: webpack.Configuration = {
|
2020-06-11 19:27:15 +08:00
|
|
|
mode: devMode ? 'development' : 'production',
|
|
|
|
entry: {
|
|
|
|
meta: './resources/assets/src/scripts/meta.ts',
|
|
|
|
sw: './resources/assets/src/scripts/sw.ts',
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: `${__dirname}/public`,
|
|
|
|
filename: '[name].js',
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.ts$/,
|
|
|
|
loader: 'ts-loader',
|
|
|
|
options: {
|
|
|
|
configFile: 'tsconfig.build.json',
|
|
|
|
transpileOnly: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.js', '.ts', '.tsx', '.json'],
|
|
|
|
},
|
|
|
|
stats: 'errors-only',
|
|
|
|
}
|
2020-07-03 16:30:46 +08:00
|
|
|
|
|
|
|
export default config
|