forked from fullcalendar/fullcalendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.bundles.js
51 lines (47 loc) · 1.4 KB
/
webpack.bundles.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
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { checkNoSymlinks } = require('./scripts/lib/new')
const { buildEntryMap, buildAliasMap } = require('./scripts/lib/new-webpack')
const { bundleStructs, publicPackageStructs } = require('./scripts/lib/package-index')
checkNoSymlinks(bundleStructs) // can we avoid this if we only ever write js?
module.exports = (env) => {
let doSourceMaps = !(env && env.NO_SOURCE_MAPS)
return {
mode: 'development',
devtool: doSourceMaps ? 'source-map' : false,
entry: buildEntryMap(bundleStructs),
output: {
filename: '[name].js',
path: __dirname,
library: 'FullCalendar',
libraryTarget: 'var'
},
resolve: {
extensions: [ '.ts', '.tsx', '.js' ],
alias: buildAliasMap(publicPackageStructs)
},
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{ loader: 'ts-loader', options: { transpileOnly: true } }
]
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { sourceMap: doSourceMaps, importLoaders: 1 } },
{ loader: 'postcss-loader', options: { sourceMap: doSourceMaps } }
]
}
]
},
plugins: [
new MiniCssExtractPlugin()
],
stats: {
warningsFilter: /export .* was not found in/
}
}
}