forked from pipwerks/PDFObject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
89 lines (85 loc) · 2.03 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// const HtmlWebpackPlugin = require('html-webpack-plugin');
// const CopyWebpackPlugin = require('copy-webpack-plugin');
// const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require('path')
module.exports = {
mode: 'development',
devtool: 'sourcemap',
entry: './src/index.js',
output: {
path: __dirname + '/bundle',
filename: 'index.js',
chunkFilename: '[name].chunk.js',
libraryTarget: 'umd',
library: 'Charts'
},
optimization: {
splitChunks: {
chunks: 'all'
}
},
resolve: {
// Add '.ts' and '.tsx' as a resolvable extension.
extensions: ['.webpack.js', '.web.js', '.ts', '.tsx', '.js']
},
module: {
rules: [
// all files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'
{
include: [path.resolve(__dirname, 'src')],
loader: 'babel-loader',
options: {
plugins: ['syntax-dynamic-import'],
presets: [
[
'env',
{
modules: false
}
]
]
},
test: /\.js$/
}
// { test: /\.ts$/, loader: 'ts-loader' }
// { test: /\.html?$/, loader: "html-loader" },
// {
// test: /\.s?css$/,
// use: [
// {
// loader: MiniCssExtractPlugin.loader
// },
// "css-loader",
// "postcss-loader",
// "sass-loader"
// ]
// },
// {
// test: /\.(jpg|png|gif|eot|ttf|woff|woff2)$/,
// loader: 'url-loader'
// },
// {
// test: /\.svg?$/,
// loader: 'raw-loader'
// }
]
},
plugins: [
// new MiniCssExtractPlugin({
// filename: "bundle.css"
// }),
// new HtmlWebpackPlugin({
// template: './demo/index.html'
// }),
// new CopyWebpackPlugin([
// { from: 'demo/assets' }
// ])
]
// devServer: {
// contentBase: "./demo",
// host: "0.0.0.0",
// port: 9001,
// historyApiFallback: true,
// disableHostCheck: true
// }
}