Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Commit

Permalink
Update dev config
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 2, 2017
1 parent 397b956 commit 9c49d12
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"presets": ["latest", "react"],
"plugins": ["react-hot-loader/babel"],
"plugins": ["transform-object-rest-spread", "react-hot-loader/babel"],
"env": {
"production": {
"presets": [
"react-optimize"
],
"plugins": [
"transform-react-constant-elements",
"transform-react-remove-prop-types",
"transform-react-inline-elements"
]
}
}
Expand Down
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@
"autoprefixer": "~6.7.0",
"babel-core": "~6.22.1",
"babel-loader": "~6.2.10",
"babel-plugin-transform-object-rest-spread": "~6.22.0",
"babel-plugin-transform-react-constant-elements": "~6.22.0",
"babel-plugin-transform-react-inline-elements": "~6.22.0",
"babel-plugin-transform-react-remove-prop-types": "~0.2.11",
"babel-preset-latest": "~6.22.0",
"babel-preset-react": "~6.22.0",
"css-loader": "~0.26.1",
"extract-text-webpack-plugin": "~1.0.1",
"extract-text-webpack-plugin": "~2.0.0-rc.2",
"file-loader": "~0.10.0",
"html-webpack-harddisk-plugin": "0.0.2",
"html-webpack-plugin": "~2.28.0",
Expand All @@ -46,20 +47,20 @@
"purifycss-webpack-plugin": "~2.0.3",
"react": "~15.4.2",
"react-dom": "~15.4.2",
"react-hot-loader": "~3.0.0-beta.1",
"react-hot-loader": "~3.0.0-beta.6",
"sass-loader": "~4.1.1",
"style-loader": "~0.13.1",
"tachyons-sass": "~4.7.1",
"travis-after-all": "~1.4.4",
"url-loader": "~0.5.7",
"webpack": "~2.2.1",
"webpack-dev-server": "~2.2.1"
"webpack": "~2.2.1"
},
"devDependencies": {
"browser-sync": "~2.18.6",
"browser-sync-webpack-plugin": "~1.1.3",
"standard": "~8.6.0",
"webpack-dev-server": "~1.16.2"
"babel-preset-react-optimize": "latest",
"browser-sync": "latest",
"browser-sync-webpack": "latest",
"standard": "latest",
"webpack-dev-server": "2"
},
"engines": {
"node": ">= 4"
Expand Down
6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: [
require('postcss-focus'),
require('autoprefixer')
]
}
38 changes: 24 additions & 14 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
'use strict'

const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin')
const BrowserSyncPlugin = require('browser-sync-webpack-plugin')
const BrowserSyncPlugin = require('browser-sync-webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const config = require('./config.json')
const webpack = require('webpack')
const path = require('path')

const pkg = require('./package.json')
const config = require('./config.json')
const {HotModuleReplacementPlugin, NoEmitOnErrorsPlugin} = webpack

module.exports = {
performance: {
hints: false
},
devtool: 'eval',
entry: [
'react-hot-loader/patch',
Expand All @@ -20,18 +26,21 @@ module.exports = {
filename: 'assets/js/bundle.js'
},
resolve: {
extensions: ['', '.scss', '.css', '.js', '.json'],
modulesDirectories: ['node_modules']
extensions: ['.scss', '.css', '.js', '.json'],
modules: ['node_modules']
},
plugins: [
new webpack.DefinePlugin({
'APP_VERSION': JSON.stringify(pkg.version)
}),
new HtmlWebpackPlugin(Object.assign({}, config, {
template: path.resolve('index.ejs'),
alwaysWriteToDisk: true,
inject: false
})),
new HtmlWebpackHarddiskPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new HotModuleReplacementPlugin(),
new NoEmitOnErrorsPlugin(),
new BrowserSyncPlugin(
// BrowserSync options
{
Expand All @@ -53,18 +62,19 @@ module.exports = {
)
],
module: {
loaders: [{
rules: [{
test: /(\.js|\.jsx)$/,
exclude: /node_modules/,
loaders: ['babel'],
loader: 'babel-loader?cacheDirectory',
include: path.resolve('src/app')
}, {
test: /(\.scss|\.css)$/,
loader: 'style!css!sass!postcss'
loader: [
'style-loader',
'css-loader',
'sass-loader',
'postcss-loader'
]
}]
},
postcss: [
require('postcss-focus'),
require('autoprefixer')
]
}
}

0 comments on commit 9c49d12

Please sign in to comment.