Skip to content

Commit 67a218f

Browse files
author
Kamil Kisiela
committed
fix: commonjs support for es6 modules
1 parent 9f0df5f commit 67a218f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"babel-core": "^6.4.5",
3838
"babel-eslint": "^4.1.6",
3939
"babel-loader": "^6.2.1",
40+
"babel-plugin-add-module-exports": "^0.1.2",
4041
"babel-preset-es2015": "^6.3.13",
4142
"commitizen": "^2.5.0",
4243
"conventional-changelog-cli": "^1.1.1",

src/angular-meteor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import { name as viewModelName, ViewModel } from './modules/view-model';
2323
import { name as reactiveName, Reactive } from './modules/reactive';
2424
import { name as templatesName } from './modules/templates';
2525

26-
export const name = 'angular-meteor';
26+
const name = 'angular-meteor';
27+
export default name;
2728

2829
angular.module(name, [
2930
// new

webpack/common.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ var common = {
1111
},
1212
output: {
1313
// point to root directory so we can avoid using ../../
14-
path: path.join(__dirname, '../')
14+
path: path.join(__dirname, '../'),
15+
library: 'angularMeteor',
16+
libraryTarget: 'umd'
1517
},
18+
target: 'web',
1619
// global variables
1720
externals: {
1821
angular: 'angular',
@@ -24,7 +27,8 @@ var common = {
2427
},
2528
// global configuration of babel loader
2629
babel: {
27-
presets: ['es2015']
30+
presets: ['es2015'],
31+
plugins: ['add-module-exports']
2832
},
2933
eslint: {
3034
quiet: true,

0 commit comments

Comments
 (0)