This repository was archived by the owner on Apr 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (61 loc) · 1.47 KB
/
webpack.config.js
File metadata and controls
63 lines (61 loc) · 1.47 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
const path = require('path');
const webpack = require('webpack');
module.exports = function() {
process.env.NODE_ENV = 'production';
return /** @type webpack.Configuration */ {
devtool: 'sourcemap',
entry: {
assistedsearch: path.join(__dirname, 'src/index.js')
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'build.js'
},
plugins: [new webpack.optimize.ModuleConcatenationPlugin()],
module: {
rules: [
{
test: /\.[js]sx?$/,
enforce: 'pre',
loader: 'eslint-loader'
},
{
test: /\.jsx?$/,
loader: 'babel-loader',
include: [].concat([path.join(__dirname, 'src')])
},
{
test: /\.tsx?$/,
loader: ['babel-loader', 'ts-loader'],
include: [].concat([path.join(__dirname, 'src')])
},
{
test: /\.scss$/,
use: [
{
loader: 'css-loader',
options: {
modules: false,
minimize: true,
sourceMap: true
}
},
{
loader: 'postcss-loader'
},
{
loader: 'sass-loader',
query: {
sourceMap: true
}
}
]
}
]
},
externals: ['react', 'react-dom', 'lodash'],
resolve: {
extensions: ['.js', '.json', '.ts', '.tsx']
}
};
};