diff --git a/src/fake-luxon.ts b/src/fake-luxon.ts new file mode 100644 index 00000000..42b1a6fd --- /dev/null +++ b/src/fake-luxon.ts @@ -0,0 +1,5 @@ +export const DateTime = { + fromJSDate() { + throw new TypeError(); + } +}; diff --git a/webpack.config.js b/webpack.config.js index 42e04419..a764dd9f 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -54,9 +54,9 @@ const rruleConfig = Object.assign({ rrule: path.join(paths.source, "index.ts"), 'rrule.min': path.join(paths.source, "index.ts") }, - externals: { - luxon: 'luxon' - }, + plugins: [ + new webpack.NormalModuleReplacementPlugin(/^luxon$/, './fake-luxon.ts'), + ] }, commonConfig); const rruleWithLuxonConfig = Object.assign({