Skip to content

Commit 87c4764

Browse files
author
Matt Lewis
committed
fix(umd): fix umd build imports
Closes #68
1 parent 0785327 commit 87c4764

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
"source-map-loader": "~0.1.5",
9292
"sourcemap-istanbul-instrumenter-loader": "~0.2.0",
9393
"standard-version": "~3.0.0",
94+
"string-replace-loader": "~1.0.5",
9495
"style-loader": "~0.13.0",
9596
"stylelint": "~7.3.1",
9697
"stylelint-config-standard": "~13.0.0",
@@ -126,7 +127,7 @@
126127
"dependencies": {
127128
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.0",
128129
"@types/date-fns": "0.0.2",
129-
"calendar-utils": "0.0.30",
130+
"calendar-utils": "0.0.31",
130131
"date-fns": "^1.3.0"
131132
}
132133
}

webpack.config.umd.ts

+10
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ module.exports = {
7070
enforce: 'pre',
7171
test: /ng\-bootstrap\/util\/positioning/,
7272
loader: 'source-map-loader'
73+
}, {
74+
enforce: 'pre',
75+
test: /\.ts$/,
76+
exclude: /node_modules/,
77+
loader: 'string-replace-loader',
78+
options: {
79+
search: `import (\\w+) from \\'date\\-fns\\/`, // nasty fix for umd build to work
80+
replace: 'import * as $1 from \'date-fns/',
81+
flags: 'g'
82+
}
7383
}, {
7484
test: /\.ts$/,
7585
loader: 'awesome-typescript-loader',

0 commit comments

Comments
 (0)