forked from namespace-ee/react-calendar-timeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
87 lines (84 loc) · 2.09 KB
/
Copy pathwebpack.config.js
File metadata and controls
87 lines (84 loc) · 2.09 KB
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
const path = require('path')
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const webpack = require('webpack');
const port = process.env.PORT || 8888
const config = {
devtool: 'cheap-eval-source-map',
context: path.join(__dirname, './src'),
entry: {
demo: [
`webpack-dev-server/client?http://0.0.0.0:${port}`,
'webpack/hot/only-dev-server',
'./demo/index.tsx'
]
},
output: {
path: path.join(__dirname, './dist'),
publicPath: '',
chunkFilename: '[name].bundle.js',
filename: '[name].bundle.js'
},
watchOptions: {
aggregateTimeout: 100,
ignored: /node_modules/,
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'awesome-typescript-loader',
options: {
configFileName: 'tsconfig.json',
},
},
{
test: /\.scss$|\.css$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: { sourceMap: true },
},
'resolve-url-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true,
sassOptions: {
outputStyle: 'compressed',
},
},
},
],
}
]
},
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ['.ts', '.tsx', '.js', '.json', '.scss', '.map'],
plugins: [new TsconfigPathsPlugin({ configFile: './tsconfig.json' })],
},
// resolve: {
// extensions: ['.js', '.jsx'],
// modules: [path.resolve('./demo'), 'node_modules'],
// alias: {
// '~': path.join(__dirname, './demo'),
// 'react-calendar-timeline': path.join(__dirname, './src'),
// 'react-calendar-timeline-css': path.join(
// __dirname,
// './src/lib/Timeline.scss'
// )
// }
// },
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css',
}),
],
devServer: {
contentBase: './src/demo',
port
}
}
module.exports = config