Skip to content

Commit e139656

Browse files
authored
Merge pull request #133 from danny-andrews/fix-build
Fix test and demo
2 parents 69484ac + 96cf60b commit e139656

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

webpack.config.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const testConfig = require('./webpack.config.test');
33
const developmentConfig = require('./webpack.config.development');
44
const productionConfig = require('./webpack.config.production');
55
const autoprefixer = require('autoprefixer');
6-
const ExtractTextPlugin = require('extract-text-webpack-plugin');
76

87
const configForEnv = (env) => {
98
switch (env) {
@@ -25,19 +24,13 @@ const baseConfig = {
2524
test: /\.js$/,
2625
loader: 'babel',
2726
exclude: /node_modules/,
28-
}, {
29-
test: /\.css$/,
30-
loader: ExtractTextPlugin.extract('style-loader', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss')
3127
}
3228
]
3329
},
3430
resolve: {
35-
extensions: ['', '.scss', '.js', '.json']
31+
extensions: ['', '.css', '.scss', '.js', '.json']
3632
},
37-
postcss: [autoprefixer],
38-
plugins: [
39-
new ExtractTextPlugin('[name].css'),
40-
]
33+
postcss: [autoprefixer]
4134
};
4235

4336
module.exports = merge(baseConfig, configForEnv(process.env.NODE_ENV));

webpack.config.production.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const path = require('path');
22
const pkg = require('./package.json');
3+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
4+
const webpack = require('webpack');
35

46
const LIB_NAME = pkg.name;
57

@@ -13,5 +15,19 @@ module.exports = {
1315
library: 'ReactFlexboxGrid',
1416
filename: '[name].js',
1517
},
16-
externals: ['react']
18+
module: {
19+
loaders: [
20+
{
21+
test: /\.css$/,
22+
loader: ExtractTextPlugin.extract('style-loader', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss')
23+
}
24+
],
25+
},
26+
externals: ['react'],
27+
plugins: [
28+
new webpack.DefinePlugin({
29+
'process.env.NODE_ENV': JSON.stringify('production')
30+
}),
31+
new ExtractTextPlugin('[name].css')
32+
]
1733
};

webpack.config.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const webpack = require('webpack');
33
module.exports = {
44
module: {
55
loaders: [{
6-
test: /(\.scss|\.css)$/,
7-
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass'
6+
test: /\.css$/,
7+
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss'
88
}]
99
},
1010
watch: true,

0 commit comments

Comments
 (0)