Skip to content

Commit eee8d7f

Browse files
Merge pull request #168 from moevm/minimize
2 parents 6fbf11c + 59a4118 commit eee8d7f

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

templates/root.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
{% block main %}{% endblock %}
1616
</div>
1717

18-
<script src={{ url_for("static", filename="all.min.js") }}></script>
19-
</html>
18+
<script src={{ url_for("static", filename="vendors.js") }}></script>
19+
<script src={{ url_for("static", filename="main.js") }}></script>
20+
</html>

webpack.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@ module.exports = {
77
entry: ['core-js/stable', 'regenerator-runtime/runtime', "./assets/scripts/main.js"],
88
output: {
99
path: path.join(__dirname, './src/'),
10-
filename: "./all.min.js"
10+
filename: "./[name].js"
1111
},
1212
optimization: {
13-
minimize: true
13+
splitChunks: {
14+
cacheGroups: {
15+
vendor: {
16+
name: 'vendors',
17+
test: /node_modules/,
18+
chunks: 'all',
19+
enforce: true
20+
}
21+
}
22+
}
1423
},
1524
module: {
1625
rules: [

0 commit comments

Comments
 (0)