Skip to content
This repository was archived by the owner on Nov 16, 2018. It is now read-only.

Commit 61a67ca

Browse files
authored
updates (#29)
1 parent 64cfba5 commit 61a67ca

9 files changed

+282
-16
lines changed

.babelrc

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@
44
"presets": [
55
["es2015", {"modules": false}],
66
"stage-2",
7-
"react"
7+
"react",
8+
["env", {
9+
"targets": {
10+
"browsers": [
11+
"last 2 versions"
12+
]
13+
},
14+
"useBuiltIns": false
15+
}]
816
],
917
"plugins": [
10-
"react-hot-loader/babel"
18+
"react-hot-loader/babel",
19+
"transform-class-properties",
20+
"transform-object-rest-spread",
21+
"system-import-transformer"
1122
]
1223
},
1324
"server": {

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto
2+
*.sh eol=lf
3+
*.cmd eol=crlf

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ npm-debug.log
44
dist
55
*.swp
66
.yarnclean
7+
yarn-error.log

.stylelintrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "stylelint-config-standard",
3+
"plugins": [
4+
"stylelint-order"
5+
],
6+
"rules": {
7+
"indentation": 4,
8+
"color-hex-length": "long",
9+
"order/properties-alphabetical-order": true
10+
}
11+
}

.yarnrc

100644100755
File mode changed.

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@
8282
"rimraf": "2.6.2",
8383
"robotstxt-webpack-plugin": "2.0.0",
8484
"style-loader": "0.19.0",
85+
"stylelint": "8.2.0",
86+
"stylelint-config-standard": "17.0.0",
87+
"stylelint-order": "0.7.0",
8588
"webpack-dev-middleware": "1.12.0",
8689
"webpack-hot-middleware": "2.19.1",
87-
"webpack-simple-progress-plugin": "0.0.2"
90+
"webpack-simple-progress-plugin": "0.0.2",
91+
"write-file-webpack-plugin": "4.2.0"
8892
},
8993
"dependencies": {
9094
"babel-polyfill": "6.26.0",

postcss.config.js

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
browsers: ['last 2 versions'],
77
},
88
'cssnano': {
9-
autoprefixer: false, // cssnext handles ap
9+
autoprefixer: false,
1010
discardComments: {
1111
removeAll: true,
1212
},

webpack.config.js

+18-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin');
55
const HtmlWebpackPlugin = require('html-webpack-plugin');
66
const SimpleProgressPlugin = require('webpack-simple-progress-plugin');
77
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
8+
const WriteFilePlugin = require('write-file-webpack-plugin');
89
const RobotstxtPlugin = require('robotstxt-webpack-plugin').default;
910
const pkg = require('./package.json');
1011

@@ -14,7 +15,7 @@ const NODE_ENV = process.env.NODE_ENV || 'production';
1415
const isProduction = (NODE_ENV === 'production');
1516
const isDevelopment = (NODE_ENV === 'development');
1617

17-
const config = {
18+
const webpackConfig = {
1819
entry: isDevelopment
1920
? [
2021
'babel-polyfill',
@@ -52,10 +53,19 @@ const config = {
5253
use: [
5354
{
5455
loader: 'css-loader',
55-
options: {minimize: true},
56+
options: {
57+
minimize: isProduction,
58+
sourceMap: !isProduction
59+
},
5660
},
5761
{
5862
loader: 'postcss-loader',
63+
options: {
64+
sourceMap: !isProduction,
65+
config: {
66+
path: './postcss.config.js',
67+
},
68+
},
5969
},
6070
],
6171
})
@@ -124,9 +134,10 @@ const config = {
124134

125135
new CopyWebpackPlugin([
126136
{
127-
context: 'src/assets/media',
137+
context: 'src/assets',
128138
from: '**/*',
129-
to: 'assets/media',
139+
to: 'assets',
140+
ignore: ['styles/**/*'],
130141
},
131142
]),
132143

@@ -137,6 +148,8 @@ const config = {
137148
: {userAgent: '*', disallow: '/'},
138149
],
139150
}),
151+
152+
new WriteFilePlugin(), // Forces webpack-dev-server to write files.
140153
].filter(Boolean),
141154

142155
devtool: isProduction
@@ -148,4 +161,4 @@ const config = {
148161
},
149162
};
150163

151-
module.exports = config;
164+
module.exports = webpackConfig;

0 commit comments

Comments
 (0)