1
0
Fork 0

Merge pull request #13 from transitive-bullshit/feature/es5-support

transpile to es5 for node >= 4 support
This commit is contained in:
Travis Fischer 2018-03-23 20:55:57 -04:00 committed by Joost De Cock
parent 288d18f616
commit 519cd7ea8e
6 changed files with 1403 additions and 94 deletions

View file

@ -0,0 +1,51 @@
/**
* Transpiles create-react-library CLI to ES5 in order to support node >= 4.
*
* Note: we use Webpack to compile the CLI, but the generated template still
* uses Rollup for compiling the library. We don't judge between the two, but
* rather try to use the best tool for the job.
*/
'use strict'
const nodeExternals = require('webpack-node-externals')
const path = require('path')
module.exports = {
target: 'node',
node: {
__dirname: false,
__filename: false,
process: false
},
entry: [
'./index.js'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'index.js'
},
externals: [
nodeExternals()
],
module: {
loaders: [
{
loader: 'babel-loader',
test: /.js$/,
exclude: /node_modules/,
query: {
babelrc: false,
plugins: [
'transform-async-to-generator',
'transform-runtime'
],
presets: [
'env',
'stage-0'
]
}
}
]
}
}