Skip to content

Commit 7d4d1a7

Browse files
author
foisonocean
committed
fix babel-plugin-external-helpers in webpack
See: babel/babel-loader#157
1 parent 92d18b8 commit 7d4d1a7

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
demo/src/external-helpers.js

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ typings/
2020
lib/
2121
es/
2222
umd/
23+
24+
# babel external helpers
25+
#
26+
demo/src/external-helpers.js

demo/webpack.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
const path = require('path');
2+
const { writeFileSync } = require('fs');
23
const webpack = require('webpack');
4+
const babel = require('babel-core');
5+
6+
writeFileSync(
7+
path.resolve(__dirname, 'src/external-helpers.js'),
8+
babel.buildExternalHelpers(),
9+
);
310

411
module.exports = {
512
devtool: 'eval',
@@ -8,7 +15,8 @@ module.exports = {
815
'webpack-dev-server/client?http://localhost:3000',
916
'webpack/hot/only-dev-server',
1017
'babel-polyfill',
11-
'./demo/src/index.js',
18+
path.resolve(__dirname, 'src/external-helpers.js'),
19+
path.resolve(__dirname, 'src/index.js'),
1220
],
1321
output: {
1422
path: path.join(__dirname, 'static'),

0 commit comments

Comments
 (0)