2020-01-29 04:16:48 +01:00
|
|
|
const webpack = require("webpack");
|
|
|
|
const path = require('path');
|
|
|
|
const CopyPlugin = require('copy-webpack-plugin');
|
|
|
|
const srcDir = '../src/';
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: {
|
|
|
|
popup: path.join(__dirname, srcDir + 'popup.ts'),
|
|
|
|
background: path.join(__dirname, srcDir + 'background.ts'),
|
2020-02-04 04:34:43 +01:00
|
|
|
content: path.join(__dirname, srcDir + 'content.ts'),
|
|
|
|
options: path.join(__dirname, srcDir + 'options.ts')
|
2020-01-29 04:16:48 +01:00
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, '../dist/js'),
|
|
|
|
filename: '[name].js'
|
|
|
|
},
|
|
|
|
optimization: {
|
|
|
|
splitChunks: {
|
|
|
|
name: 'vendor',
|
|
|
|
chunks: "initial"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
use: 'ts-loader',
|
|
|
|
exclude: /node_modules/
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.tsx', '.js']
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
// exclude locale files in moment
|
|
|
|
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
|
|
|
|
new CopyPlugin([
|
|
|
|
{ from: '.', to: '../' }
|
|
|
|
],
|
|
|
|
{context: 'public' }
|
|
|
|
),
|
|
|
|
]
|
|
|
|
};
|