Last active
September 5, 2017 16:30
-
-
Save iiison/da4383ec271586f8a57842cc5263b0ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export devStyleConfig from './style-config-dev' | |
export prodStyleConfig from './style-config-prod' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cssNanoConfigs from './cssNanoConfigs.json' | |
const LAUNCH_COMMAND = process.env.npm_lifecycle_event | |
const isProd = LAUNCH_COMMAND === 'production' | |
const devStyleConfig = [ | |
{ | |
'loader' : 'style-loader' | |
}, | |
{ | |
'loader' : 'css-loader', | |
options : { | |
importLoaders : 1, | |
modules : true, | |
import : true, | |
minimize : cssNanoConfigs, | |
sourceMap : !isProd, | |
camelCase : true, | |
localIdentName : '[path][name]---[local]---[hash : base64 : 5]' | |
} | |
}, | |
{ | |
loader : 'postcss-loader' | |
} | |
] | |
export default devStyleConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cssNanoConfigs from './cssNanoConfigs.json' | |
const LAUNCH_COMMAND = process.env.npm_lifecycle_event | |
const isProd = LAUNCH_COMMAND === 'production' | |
const prodStyleConfig = { | |
fallback: 'style-loader', | |
use : [ | |
{ | |
loader : 'css-loader', | |
options : { | |
importLoaders : 1, | |
modules : true, | |
import : true, | |
minimize : cssNanoConfigs, | |
sourceMap : !isProd, | |
camelCase : true, | |
localIdentName : '[path][name]---[local]---[hash : base64 : 5]' | |
} | |
}, | |
{ | |
loader : 'postcss-loader' | |
} | |
] | |
} | |
export default prodStyleConfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment