-
Notifications
You must be signed in to change notification settings - Fork 11
/
webpack.config.js
40 lines (38 loc) · 1.04 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
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const CSS_LOADERS = ['style-loader', 'css-loader', 'postcss-loader'];
module.exports = {
devtool: 'source-map',
context: path.join(__dirname),
entry: {
javascript: './example/app.tsx',
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'appbundle.js',
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
alias: {
'react/lib/ReactMount': 'react-dom/lib/ReactMount',
sinon: 'sinon/pkg/sinon',
},
},
plugins: [
new HtmlWebpackPlugin({
title: 'DAG History Component Example',
}),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.ProvidePlugin({
saveAs: 'imports?this=>global!exports?global.saveAs!filesaver.js',
}),
],
module: {
rules: [
{ test: /\.css$/, use: CSS_LOADERS },
{ test: /\.scss$/, use: [...CSS_LOADERS, 'sass-loader'] },
{ test: /\.ts(x|)/, use: ['ts-loader'], exclude: /node_modules/ },
],
},
};