Формат классов в зависимости от env

This commit is contained in:
SleepWalker 2016-01-09 14:15:31 +02:00
parent d2192b6057
commit dbe933d2a5

View File

@ -8,8 +8,6 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
var cssnano = require('cssnano');
var iconfontImporter = require('./webpack/node-sass-iconfont-importer');
const API_HOST = 'http://account.l';
/**
* TODO: https://babeljs.io/docs/plugins/
* TODO: отдельные конфиги для env (аля https://github.com/davezuko/react-redux-starter-kit)
@ -28,6 +26,9 @@ var isTest = process.argv.some(function(arg) {
return arg.indexOf('karma') !== -1;
});
const API_HOST = 'http://account.l';
const CSS_CLASS_TEMPLATE = isProduction ? '[hash:base64]' : '[path][name]-[local]';
var webpackConfig = {
entry: {
app: path.join(__dirname, 'src'),
@ -102,7 +103,7 @@ var webpackConfig = {
{
test: /\.scss$/,
extractInProduction: true,
loader: 'style!css?modules&importLoaders=2&localIdentName[=path][name]-[local]!postcss!sass'
loader: 'style!css?modules&importLoaders=2&localIdentName=' + CSS_CLASS_TEMPLATE + '!postcss!sass'
},
{
test: /\.jsx?$/,