Skip to content

Instantly share code, notes, and snippets.

@joefiorini joefiorini/.babelrc
Last active May 22, 2016

Embed
What would you like to do?
{
"presets": ["es2015", "stage-2", "react"],
"plugins": [
"react-hot-loader/babel",
"transform-function-bind",
"transform-class-properties",
"transform-export-extensions",
],
"env": {
"backend": {
"plugins": [
[ "webpack-loaders",
{ "config": "./webpack.config.babel.js"
, "verbose": true
}
]
]
}
}
}
}
env BABEL_DISABLE_CACHE=1 NODE_ENV=backend babel-node test.js
.blah {
color: diddy;
}
const css = require('./test.css');
console.log(css);
import { resolve, join } from 'path';
import cssnext from 'postcss-cssnext';
import autoreset from 'postcss-autoreset';
import lost from 'lost';
import pxtorem from 'postcss-pxtorem';
import webpack from 'webpack';
require('dotenv').config();
const { HOST = '0.0.0.0', BUILD_SERVER_PORT = 8001 } = process.env;
const serverAddress = `http://${HOST}:${BUILD_SERVER_PORT}/`;
export default {
context: resolve(join(__dirname, '../src'))
// , entry:
// { app:
// [ 'react-hot-loader/patch'
// , `webpack-hot-middleware/client?path=${serverAddress}__webpack_hmr`
// , 'webpack/hot/only-dev-server'
// , './'
// ]
// }
, target: 'web'
, devtool: 'source-map'
, output:
{ path: resolve('./dist')
// , filename: 'bundle.js'
, hash: true
, publicPath: serverAddress
, libraryTarget: 'commonjs2'
}
, module:
{ loaders:
[ { test: /\.js$/, loader: 'babel', query: { babelrc: true } }
, { test: /\.svg$/
, loader: 'babel!svg-react!svgo'
}
, { test: /\.css$/
, loader: `style!css?modules&importLoaders=1
&localIdentName=[name]__[local]___[hash:base64:5]!postcss`
}
]
}
, plugins:
[ new webpack.EnvironmentPlugin(Object.keys(process.env))
, new webpack.HotModuleReplacementPlugin()
]
, devServer:
{ url: `http://${HOST}:${BUILD_SERVER_PORT}`
, host: HOST
, port: BUILD_SERVER_PORT
}
, postcss:
() => [ cssnext, lost, pxtorem({ propWhiteList: [] }) ]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.