-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
executable file
·47 lines (46 loc) · 1.25 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
// This library allows us to combine paths easily
const path = require('path');
module.exports = {
entry: path.resolve(__dirname, 'src', 'index.js'),
output: {
path: path.resolve(__dirname, './build'),
publicPath: path.resolve(__dirname, './build'),
filename: 'index.js',
libraryTarget: 'commonjs2'
},
resolve: {
alias: {
src: path.resolve(__dirname, 'src')
}
},
module: {
rules: [
{
test: /\.js/,
exclude: /node_modules|build/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.scss/,
use: ['style-loader', 'css-loader', 'postcss-loader', {
loader: 'sass-loader',
options: {
includePaths: ['src/styles', 'node_modules', 'public']
}
}]
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
loader: "file-loader"
}
]
},
externals: {
'react': 'commonjs2 react', // this line is just to use the React dependency of our parent-testing-project instead of using our own React.
'react-dom': 'commonjs2 react-dom',
'@fortawesome/fontawesome': 'commonjs2 @fortawesome/fontawesome',
'@fortawesome/fontawesome-free-solid': 'commonjs2 @fortawesome/fontawesome-free-solid'
}
};