-
Notifications
You must be signed in to change notification settings - Fork 520
/
webpack.config.js
31 lines (27 loc) · 1.01 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
import Encore from "@symfony/webpack-encore";
import { PurgeCSSPlugin } from "purgecss-webpack-plugin";
import { glob } from "glob";
Encore.addEntry("app", "./views/assets/js/app.js")
.addStyleEntry("style", "./views/assets/css/style.scss")
.cleanupOutputBeforeBuild()
.disableSingleRuntimeChunk()
.enableSassLoader()
.enableSourceMaps(!Encore.isProduction())
.setOutputPath("views/build/")
.setPublicPath("/build")
.addPlugin(
new PurgeCSSPlugin({
paths: () =>
glob.sync([`views/*.html.twig`, `views/assets/js/**/*.js`], {
nodir: true,
}),
}),
);
const config = Encore.getWebpackConfig();
// Set IE11-friendly defaults
// https://webpack.js.org/configuration/output/#outputenvironment
config.output.environment = config.output.environment || {};
config.output.environment.arrowFunction = false;
config.output.environment.const = false;
config.output.environment.destructuring = false;
export { config as default };