Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Fix wrong minify option in HtmlWebpackPlugin #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions webpack.make.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ module.exports = function makeWebpackConfig (options) {
* Karma will set this when it's a test build
*/
if (TEST) {
config.entry = {}
config.entry = {};
} else {
config.entry = {
app: './src/app.js'
}
};
}

/**
Expand All @@ -43,7 +43,7 @@ module.exports = function makeWebpackConfig (options) {
* Karma will handle setting it up for you when it's a test build
*/
if (TEST) {
config.output = {}
config.output = {};
} else {
config.output = {
// Absolute output directory
Expand All @@ -60,7 +60,7 @@ module.exports = function makeWebpackConfig (options) {
// Filename for non-entry points
// Only adds hash in build mode
chunkFilename: BUILD ? '[name].[hash].js' : '[name].bundle.js'
}
};
}

/**
Expand Down Expand Up @@ -124,7 +124,7 @@ module.exports = function makeWebpackConfig (options) {
/\.test\.js$/
],
loader: 'isparta-instrumenter'
})
});
}

// CSS LOADER
Expand All @@ -147,7 +147,7 @@ module.exports = function makeWebpackConfig (options) {
if (TEST) {
// Reference: https://github.com/webpack/null-loader
// Return an empty module
cssLoader.loader = 'null'
cssLoader.loader = 'null';
}

// Add cssLoader to the loader list
Expand Down Expand Up @@ -186,9 +186,11 @@ module.exports = function makeWebpackConfig (options) {
new HtmlWebpackPlugin({
template: './src/index.html',
inject: 'body',
minify: BUILD
minify: {
removeAttributeQuotes: true
}
})
)
);
}

// Add build specific plugins
Expand All @@ -205,7 +207,7 @@ module.exports = function makeWebpackConfig (options) {
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
// Minify all javascript, switch loaders to minimizing mode
new webpack.optimize.UglifyJsPlugin()
)
);
}

/**
Expand All @@ -224,4 +226,4 @@ module.exports = function makeWebpackConfig (options) {
};

return config;
};
};