Skip to content

Commit

Permalink
fix: reduce size of imported background code
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Jan 3, 2018
1 parent 94c70ee commit 7a83c56
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 20 deletions.
1 change: 0 additions & 1 deletion src/action/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<script src="/src/manifest.bundle.js"></script>
<script src="/src/vue.bundle.js"></script>
<script src="/src/commons.bundle.js"></script>
<script src="/src/commons-ui/commons.bundle.js"></script>
<script src="action.bundle.js"></script>
</body>
Expand Down
1 change: 0 additions & 1 deletion src/background/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<body>

<script src="/src/manifest.bundle.js"></script>
<script src="/src/commons.bundle.js"></script>
<script src="background.bundle.js"></script>
</body>
</html>
1 change: 0 additions & 1 deletion src/contribute/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

<script src="/src/manifest.bundle.js"></script>
<script src="/src/vue.bundle.js"></script>
<script src="/src/commons.bundle.js"></script>
<script src="/src/commons-ui/commons.bundle.js"></script>
<script src="contribute.bundle.js"></script>
</body>
Expand Down
1 change: 0 additions & 1 deletion src/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<script src="/src/manifest.bundle.js"></script>
<script src="/src/vue.bundle.js"></script>
<script src="/src/commons.bundle.js"></script>
<script src="/src/commons-ui/commons.bundle.js"></script>
<script src="options.bundle.js"></script>
</body>
Expand Down
17 changes: 1 addition & 16 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
const targetEnv = process.env.TARGET_ENV || 'firefox';
const isProduction = process.env.NODE_ENV === 'production';

const uiModules = ['options', 'action', 'contribute'];
let plugins = [
new webpack.DefinePlugin({
'process.env': {
Expand All @@ -27,21 +26,7 @@ let plugins = [
new webpack.optimize.CommonsChunkPlugin({
name: 'commons-ui',
filename: '[name]/commons.bundle.js',
chunks: uiModules,
minChunks: function(module, count) {
return (
module.resource &&
/\/(@material|ext-(components|contribute)|(css|vue)-loader|src\/(options|action|contribute))\//.test(
module.resource
) &&
count >= 2
);
}
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'commons',
filename: '[name].bundle.js',
chunks: ['background', ...uiModules],
chunks: ['options', 'action', 'contribute'],
minChunks: 2
}),
isProduction ? new webpack.optimize.ModuleConcatenationPlugin() : null,
Expand Down

0 comments on commit 7a83c56

Please sign in to comment.