Skip to content

Commit d2d4838

Browse files
committed
Ajustes configuração de Tree Shaking / Dedup de dependencias no webpack
1 parent 49faa3f commit d2d4838

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"presets" : [ "es2015", "react", "stage-0" ],
2+
"presets" : [ ["es2015", { "modules": false }], "react", "stage-0" ],
33
"plugins" : [ "transform-decorators-legacy" ]
44
}

webpack.config.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const webpack = require('webpack');
12
const path = require('path');
23
const ExtractTextPlugin = require('extract-text-webpack-plugin');
34

@@ -48,8 +49,20 @@ module.exports = {
4849
window: 'Materialize',
4950
root: 'Materialize',
5051
},
51-
moment: 'moment',
52-
numeral: 'numeral',
52+
moment: {
53+
commonjs: 'moment',
54+
commonjs2: 'moment',
55+
amd: 'moment',
56+
window: 'moment',
57+
root: 'moment',
58+
},
59+
numeral: {
60+
commonjs: 'numeral',
61+
commonjs2: 'numeral',
62+
amd: 'numeral',
63+
window: 'numeral',
64+
root: 'numeral',
65+
},
5366
react: {
5467
commonjs: 'react',
5568
commonjs2: 'react',
@@ -94,5 +107,7 @@ module.exports = {
94107

95108
plugins: [
96109
new ExtractTextPlugin('realizejs.css'),
110+
new webpack.IgnorePlugin(/\.\/locale/, /moment/),
111+
new webpack.IgnorePlugin(/\.\/locales/, /numeral/),
97112
],
98113
};

0 commit comments

Comments
 (0)