Skip to content

Commit

Permalink
Merge pull request #1109 from PrefectHQ/tree-shake/moment
Browse files Browse the repository at this point in the history
tree shaking moment dependency
  • Loading branch information
zhen0 authored Nov 4, 2021
2 parents 34439df + 8fa135c commit 6308745
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- When creating/editing schedule, make action button available across tabs - [#1096](https://github.com/PrefectHQ/ui/pull/1096)

### Bugfixes
- Removed unused locale files from moment dependency - [#1109](https://github.com/PrefectHQ/ui/pull/1109)
- Moved away from discouraged per-method-packaging of lodash - [#1107](https://github.com/PrefectHQ/ui/pull/1107)
- Removed unnecessary dependency preventing us from tree shaking highlightjs - [#1108](https://github.com/PrefectHQ/ui/pull/1108)

Expand Down
12 changes: 11 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const WorkerPlugin = require('worker-plugin')
const webpack = require('webpack')

module.exports = {
chainWebpack: config => {
Expand Down Expand Up @@ -82,7 +83,13 @@ module.exports = {
}
}
},
plugins: [new WorkerPlugin({ sharedWorker: true })]
plugins: [
new WorkerPlugin({ sharedWorker: true }),
new webpack.ContextReplacementPlugin(
/moment[/\\]locale$/,
/en-au|en-ca|en-us|en-mx/
)
]
},

pluginOptions: {
Expand All @@ -93,6 +100,9 @@ module.exports = {
},
webpackBundleAnalyzer: {
analyzerMode: 'disabled'
// you can uncomment this line, run npm build, this will generate dist/stats.json which can be viewed here
// https://chrisbateman.github.io/webpack-visualizer/
//generateStatsFile: true
}
},

Expand Down

0 comments on commit 6308745

Please sign in to comment.