Skip to content

Instantly share code, notes, and snippets.

@MrRoyce
Created September 26, 2016 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrRoyce/3ba2f36e50cab5fc8c3c17122f8c0e6d to your computer and use it in GitHub Desktop.
Save MrRoyce/3ba2f36e50cab5fc8c3c17122f8c0e6d to your computer and use it in GitHub Desktop.
bable.prod.js to debug Module not found: Error: Cannot resolve module 'babel-runtime'
const
path = require('path')
;
module.exports = {
babelrc: false,
presets: [
'babel-preset-es2015',
'babel-preset-es2016',
'babel-preset-react'
].map(require.resolve),
plugins: [
'babel-plugin-syntax-trailing-function-commas',
'babel-plugin-syntax-async-functions',
'babel-plugin-transform-class-properties',
'babel-plugin-transform-regenerator',
'babel-plugin-transform-object-rest-spread',
'babel-plugin-transform-react-constant-elements'
].map(require.resolve).concat([
[require.resolve('babel-plugin-transform-runtime'), {
helpers: false,
polyfill: false,
regenerator: true,
moduleName: path.dirname(require.resolve('babel-runtime/package'))
}]
])
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment