-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
36 lines (32 loc) · 940 Bytes
/
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
const Encore = require('@symfony/webpack-encore');
const config = require('dotenv').config().parsed;
const path = require('path');
Encore
.setOutputPath('web/build/')
.setPublicPath(config.WEBPACK_PUBLIC_PATH)
.cleanupOutputBeforeBuild()
.enableReactPreset()
.enableSassLoader()
.addEntry('app', ['./web-assets/SparePartsApp.jsx'])
.addStyleEntry('tags_style', [
'./node_modules/react-tagsinput/react-tagsinput.css'
])
.addLoader({
test: /\.(graphql|gql)$/,
exclude: /node_modules/,
loader: 'graphql-tag/loader',
})
.addLoader({
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets:[ 'react', 'stage-2' ]
}
})
.enableSourceMaps(!Encore.isProduction())
;
const webpackConfig = Encore.getWebpackConfig();
webpackConfig.resolve.alias = {
};
module.exports = webpackConfig;