Skip to content

Commit

Permalink
Use a consistent css ident between build profiles (#161)
Browse files Browse the repository at this point in the history
Fixes #154
  • Loading branch information
bryanforbes authored Sep 6, 2018
1 parent e69dece commit fccdd6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default function webpackConfigFactory(args: any): WebpackConfiguration {
modules: true,
sourceMap: true,
importLoaders: 1,
localIdentName: '[hash:base64:8]',
localIdentName: '[name]__[local]__[hash:base64:5]',
getLocalIdent
}
},
Expand Down
17 changes: 1 addition & 16 deletions src/dev.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function webpackConfig(args: any): webpack.Configuration {
const config = baseConfigFactory(args);
const manifest: WebAppManifest = args.pwa && args.pwa.manifest;
const serviceWorker: string | ServiceWorkerOptions = args.pwa && args.pwa.serviceWorker;
const { plugins, output, module } = config;
const { plugins, output } = config;
const outputPath = path.join(output.path!, 'dev');
const assetsDir = path.join(process.cwd(), 'assets');
const assetsDirExists = fs.existsSync(assetsDir);
Expand Down Expand Up @@ -70,21 +70,6 @@ function webpackConfig(args: any): webpack.Configuration {
);
}

module.rules = module.rules.map((rule) => {
if (Array.isArray(rule.use)) {
rule.use.forEach((loader: any) => {
if (typeof loader === 'string') {
return loader;
}
if (loader.loader === 'css-loader') {
loader.options.localIdentName = '[name]__[local]__[hash:base64:5]';
return loader;
}
});
}
return rule;
});

config.output = {
...output,
path: outputPath
Expand Down

0 comments on commit fccdd6f

Please sign in to comment.