Skip to content

Commit

Permalink
chore: prettifying configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
wuweiweiwu committed May 8, 2019
1 parent 32855b8 commit 66a1378
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if (env === 'rollup') {
module.exports = {
comments: false,
plugins: ['external-helpers'],
presets: [['env', { modules: false }], 'react', 'flow', 'stage-2'],
presets: [['env', {modules: false}], 'react', 'flow', 'stage-2'],
};
}

Expand Down
10 changes: 4 additions & 6 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module.exports = {
'autoprefixer': {
'browsers': ['last 2 version', 'Firefox 15', 'iOS 8']
autoprefixer: {
browsers: ['last 2 version', 'Firefox 15', 'iOS 8'],
},
// The plugins section is used by postcss-loader with webpack
plugins: [
require('autoprefixer')
]
}
plugins: [require('autoprefixer')],
};
32 changes: 16 additions & 16 deletions webpack.config.demo.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');

module.exports = {
devtool: 'source-map',
entry: {
demo: './source/demo/index'
demo: './source/demo/index',
},
output: {
path: path.join(__dirname, 'build'),
filename: 'static/[name].js'
filename: 'static/[name].js',
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
inject: true,
template: './index.html'
template: './index.html',
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
NODE_ENV: JSON.stringify('production'),
},
}),
],
module: {
rules: [
{
test: /\.js$/,
use: ['babel-loader'],
include: path.join(__dirname, 'source')
include: path.join(__dirname, 'source'),
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader?modules', 'postcss-loader'],
include: path.join(__dirname, 'source')
include: path.join(__dirname, 'source'),
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader?&minimize=false'],
include: path.join(__dirname, 'styles.css')
}
]
}
}
include: path.join(__dirname, 'styles.css'),
},
],
},
};
29 changes: 14 additions & 15 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,43 @@
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');

module.exports = {
devtool: 'eval',
entry: {
demo: './source/demo/index'
demo: './source/demo/index',
},
output: {
path: path.join(__dirname, 'build'),
filename: 'static/[name].js'
filename: 'static/[name].js',
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
inject: true,
template: './index.html'
})
template: './index.html',
}),
],
module: {
rules: [
{
test: /\.js$/,
use: ['babel-loader'],
include: path.join(__dirname, 'source')
include: path.join(__dirname, 'source'),
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader?modules', 'postcss-loader'],
include: path.join(__dirname, 'source')
include: path.join(__dirname, 'source'),
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader?minimize=false'],
include: path.join(__dirname, 'styles.css')
}
]
include: path.join(__dirname, 'styles.css'),
},
],
},
devServer: {
contentBase: 'build',
port: 3001
}
}
port: 3001,
},
};

0 comments on commit 66a1378

Please sign in to comment.