Load less tyle as string

This commit is contained in:
Tyler Long
2017-09-12 21:33:39 +08:00
parent 385454f3f1
commit 0a828ee67f
3 changed files with 20 additions and 8 deletions

View File

@@ -26,17 +26,22 @@ const jsRule = {
}
}
const styleRule = { // load less to string
test: /\.less$/,
use: [
{ loader: 'css-to-string-loader' },
{ loader: 'css-loader' },
{ loader: 'less-loader' }
]
}
const lessRule = {
test: /\.less$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader'
},
{
loader: 'less-loader'
}
{ loader: 'css-loader' },
{ loader: 'less-loader' }
]
})
}
@@ -58,7 +63,7 @@ export const jsConfig = () => {
libraryExport: 'default'
},
module: {
rules: [lodashRule, jsRule]
rules: [lodashRule, jsRule, styleRule]
}
}
}