Fix CSS loading for production

This commit is contained in:
Lukas Martinelli 2016-12-22 18:19:34 +01:00
parent 3ee1473a49
commit cfb7f56574
3 changed files with 7 additions and 27 deletions

View file

@ -7,14 +7,6 @@ var HtmlWebpackPlugin = require('html-webpack-plugin');
const HOST = process.env.HOST || "127.0.0.1";
const PORT = process.env.PORT || "8888";
// global css
loaders.push({
test: /[\/\\](node_modules|global)[\/\\].*\.css$/,
loaders: [
'style?sourceMap',
'css'
]
});
// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
@ -24,14 +16,6 @@ loaders.push({
'sass'
]
});
// local css modules
loaders.push({
test: /[\/\\]src[\/\\].*\.css/,
loaders: [
'style?sourceMap',
'css'
]
});
module.exports = {
target: 'web',

View file

@ -54,5 +54,12 @@ module.exports = [
test: /\.js$/,
include: /node_modules\/mapbox-gl\/js\/render\/shaders.js/,
loader: 'transform/cacheable?brfs'
},
{
test: /[\/\\](node_modules|global|src)[\/\\].*\.css$/,
loaders: [
'style?sourceMap',
'css'
]
}
];

View file

@ -6,22 +6,11 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var WebpackCleanupPlugin = require('webpack-cleanup-plugin');
// local css modules
loaders.push({
test: /[\/\\]src[\/\\].*\.css/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]')
});
// local scss modules
loaders.push({
test: /[\/\\]src[\/\\].*\.scss/,
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]', 'sass')
});
// global css files
loaders.push({
test: /[\/\\](node_modules|global)[\/\\].*\.css$/,
loader: ExtractTextPlugin.extract('style', 'css')
});
module.exports = {
entry: {