Selector/Selector.Web/webpack.common.js

50 lines
1.3 KiB
JavaScript
Raw Normal View History

2021-10-23 11:11:03 +01:00
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
entry: {
2021-10-31 19:47:07 +00:00
now: './scripts/now.ts',
2022-10-10 11:44:47 +01:00
past: './scripts/past.ts',
nowCss: './CSS/index.scss',
2021-10-23 11:11:03 +01:00
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
2021-11-09 18:17:22 +00:00
options: {
appendTsSuffixTo: [/\.vue$/],
},
2021-10-23 11:11:03 +01:00
exclude: /node_modules/,
2021-11-09 18:17:22 +00:00
},
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.scss$/,
exclude: /node_modules/,
use: [
{
loader: 'file-loader',
options: { outputPath: '../css', name: '[name].min.css'}
},
'sass-loader'
]
2021-10-23 11:11:03 +01:00
}
]
},
plugins: [
new CleanWebpackPlugin()
],
2021-11-09 18:17:22 +00:00
resolve: {
extensions: ["*", ".js", ".jsx", ".ts", ".tsx", ".vue"] ,
alias: {
vue: "vue/dist/vue.esm-bundler.js"
}
},
2021-10-23 11:11:03 +01:00
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'wwwroot/js')
}
};