-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
47 lines (46 loc) · 1.39 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const Path = require('path');
const Webpack = require('webpack');
const FileManagerPlugin = require('filemanager-webpack-plugin');
module.exports = {
entry: {
'webpack-example': './src/webpack-example.ts',
rules: './src/index.ts',
},
output: {
path: Path.join(__dirname, 'dist/'),
filename: '[name].js',
libraryTarget: 'umd',
library: 'Rules',
},
module: {
rules: [
{ test: /\.ts$/, use: 'ts-loader' },
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
],
},
resolve: { extensions: ['.js', '.ts', '.d.ts'] },
plugins: [
new FileManagerPlugin({
events: {
onEnd: {
copy: [
{
source: 'dist/rules.js',
destination: 'docs/rules.js',
},
],
delete: [
'docs/webpack-example.js',
],
move: [
{
source: 'dist/webpack-example.js',
destination: 'docs/webpack-example.js',
},
],
},
},
}),
],
};