-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.config.js
54 lines (52 loc) · 1.45 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
48
49
50
51
52
53
54
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const ReplaceInFileWebpackPlugin = require('replace-in-file-webpack-plugin');
module.exports = {
entry: './src/main.ts',
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader'
},
{
test: /\.s?css$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"sass-loader"
]
}
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
chunkFilename: "[id].css"
}),
// FullCalendar uses '@fullcalendar/core' as a module name in the ES6 module system but
// 'FullCalendar' in the compiled ES5 file
new ReplaceInFileWebpackPlugin([{
dir: 'dist',
files: ['main.js'],
rules: [{
search: /@fullcalendar\/core/g,
replace: 'FullCalendar'
}]
}])
],
optimization: {
minimize: false
},
externals: /(fullcalendar|moment)/i,
output: {
library: "FullCalendarYearView",
libraryTarget: "umd",
globalObject: "this",
filename: 'main.js',
path: path.resolve(__dirname, 'dist'),
}
};