1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-11 09:45:24 +01:00
Pinafore-Web-Client-Frontend/webpack/shared.config.js
Nolan Lawson 16e66346d7
fix!: remove esm package, use native Node ES modules (#2064)
BREAKING CHANGE: Node v12.20+, v14.14+, or v16.0+ is required

* fix!: remove esm package, use native Node ES modules

* fix: fix some CJS imports
2021-07-04 20:19:04 -07:00

25 lines
796 B
JavaScript

import svgs from '../bin/svgs.js'
const inlineSvgs = svgs.filter(_ => _.inline).map(_ => `#${_.id}`)
const mode = process.env.NODE_ENV || 'production'
const dev = mode === 'development'
const resolve = {
extensions: ['.js', '.json', '.html'],
mainFields: ['svelte', 'module', 'browser', 'main'],
alias: {
// All browsers we target support Intl.PluralRules (or it's polyfilled).
// So format-message-interpret can fall back to that. This file is pretty big (9.83kB) and it's not needed.
'./plurals': '@stdlib/utils-noop',
'lookup-closest-locale': '@stdlib/utils-noop', // small, but also not needed
'svelte/store.umd.js': 'svelte/store.js' // have to use UMD for Mocha, but in Webpack we can use the ESM version
}
}
export {
mode,
dev,
resolve,
inlineSvgs
}