Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Commit

Permalink
Use version number from babel-standalone's package.json rather than t…
Browse files Browse the repository at this point in the history
…he Babel core version number.

Closes #59
  • Loading branch information
Daniel15 committed Nov 20, 2016
1 parent 72fd057 commit 2a1bb0f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const webpack = require('webpack');
const webpackStream = require('webpack-stream');
const uglify = require('gulp-uglify');

function webpackBuild(filename, libraryName) {
function webpackBuild(filename, libraryName, version) {
const config = {
module: {
loaders: [
Expand Down Expand Up @@ -37,7 +37,8 @@ function webpackBuild(filename, libraryName) {
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': '"production"'
'process.env.NODE_ENV': '"production"',
VERSION: JSON.stringify(version),
}),
// Use browser version of visionmedia-debug
new webpack.NormalModuleReplacementPlugin(
Expand Down Expand Up @@ -68,14 +69,14 @@ gulp.task('build', ['build-babel', 'build-babili']);

gulp.task('build-babel', () => {
return gulp.src('src/index.js')
.pipe(webpackBuild('babel.js', 'Babel'))
.pipe(webpackBuild('babel.js', 'Babel', require('./package.json').version))
.pipe(gulp.dest('.'))
.pipe(minifyAndRename())
.pipe(gulp.dest('.'));
});
gulp.task('build-babili', () => {
return gulp.src('src/babili.js')
.pipe(webpackBuild('babili.js', 'Babili'))
.pipe(webpackBuild('babili.js', 'Babili', require('./packages/babili-standalone/package.json').version))
.pipe(gulp.dest('packages/babili-standalone/'))
.pipe(minifyAndRename())
.pipe(gulp.dest('packages/babili-standalone/'));
Expand Down
2 changes: 2 additions & 0 deletions src/babili.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ export function transform(code, options = {}) {
]
});
}

export const version = VERSION;
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ registerPresets({
},
});

export const version = Babel.version;
export const version = VERSION;

// Listen for load event if we're in a browser and then kick off finding and
// running of scripts with "text/babel" type.
Expand Down

0 comments on commit 2a1bb0f

Please sign in to comment.