Skip to content

Commit

Permalink
feat(index): shift loaderOptions structure to be more open for other …
Browse files Browse the repository at this point in the history
…parameters (#12)

BREAKING CHANGE: use loaderOptions configuration parameter instead of htmlLoaderOptions
  • Loading branch information
dweber019 authored and niieani committed Dec 1, 2016
1 parent 0c47348 commit 7c3692b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@ import * as webpack from 'webpack'
* See: https://github.com/webpack/html-loader#advanced-options
*/
const DefaultHtmlLoaderOptions = {
minimize: true,
removeAttributeQuotes: false,
caseSensitive: true,
// customAttrSurround: [
// [/#/, /(?:)/],
// [/\*/, /(?:)/],
// [/\[?\(?/, /(?:)/]
// ],
// customAttrAssign: [/\)?\]?=/]
htmlLoader: {
minimize: true,
removeAttributeQuotes: false,
caseSensitive: true,
// customAttrSurround: [
// [/#/, /(?:)/],
// [/\*/, /(?:)/],
// [/\[?\(?/, /(?:)/]
// ],
// customAttrAssign: [/\)?\]?=/]
}
} as any

/**
* @param exclude add paths to packages that have problems with their sourcemaps
*/
export = function production({devtool = 'source-map', dedupe = false, htmlLoaderOptions = DefaultHtmlLoaderOptions} = {}) {
export = function production({devtool = 'source-map', dedupe = false, loaderOptions = {}} = {}) {
const WebpackMd5Hash = require('webpack-md5-hash')

return function production(this: WebpackConfigWithMetadata): WebpackConfigWithMetadata {
Expand Down Expand Up @@ -71,9 +73,7 @@ export = function production({devtool = 'source-map', dedupe = false, htmlLoader
* Description: Plugin to set loaders intro minimize mode
*/
new (webpack as any).LoaderOptionsPlugin({
options: {
htmlLoader: htmlLoaderOptions
}
options: Object.assign({}, DefaultHtmlLoaderOptions, loaderOptions)
}),

new webpack.DefinePlugin({
Expand Down

0 comments on commit 7c3692b

Please sign in to comment.