2019-10-04 23:38:11 +00:00
|
|
|
const path = require('path');
|
2019-10-09 02:28:32 +00:00
|
|
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
2019-09-25 00:01:54 +00:00
|
|
|
|
|
|
|
module.exports = {
|
2019-10-04 23:38:11 +00:00
|
|
|
mode: 'production',
|
|
|
|
entry: './index.ts',
|
|
|
|
output: {
|
2019-12-01 23:00:40 +00:00
|
|
|
filename: 'bundle.js'
|
2019-10-04 23:38:11 +00:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
// Add `.ts` and `.tsx` as a resolvable extension.
|
|
|
|
extensions: [ '.ts', '.tsx', '.js' ]
|
|
|
|
},
|
2019-10-09 02:28:32 +00:00
|
|
|
plugins: [
|
|
|
|
new MiniCssExtractPlugin({
|
2019-12-01 23:00:40 +00:00
|
|
|
filename: 'main.css'
|
2019-10-09 02:28:32 +00:00
|
|
|
})
|
|
|
|
],
|
2019-10-04 23:38:11 +00:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
// all files with a `.ts` or `.tsx` extension will be handled by `ts-loader`
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
loader: 'ts-loader',
|
|
|
|
options: {
|
|
|
|
allowTsInNodeModules: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2019-10-08 23:20:58 +00:00
|
|
|
test: /\.scss$/,
|
2019-10-09 02:28:32 +00:00
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: MiniCssExtractPlugin.loader
|
|
|
|
},
|
|
|
|
'css-loader',
|
|
|
|
'sass-loader'
|
|
|
|
]
|
2019-10-04 23:38:11 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
};
|