mirror of
https://github.com/nolanlawson/pinafore
synced 2024-12-12 18:28:03 +01:00
16e66346d7
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
35 lines
751 B
JavaScript
35 lines
751 B
JavaScript
import json from '@rollup/plugin-json'
|
|
|
|
// We have to build this as webpack.config.cjs so that Sapper can require() it correctly,
|
|
// since Sapper is designed to only work with CommonJS
|
|
|
|
const createConfig = (input) => {
|
|
return {
|
|
input,
|
|
plugins: [
|
|
json()
|
|
],
|
|
output: {
|
|
file: input.replace('.js', '.cjs'),
|
|
format: 'cjs',
|
|
exports: 'auto'
|
|
},
|
|
external: [
|
|
'cheerio',
|
|
'circular-dependency-plugin',
|
|
'format-message-parse',
|
|
'fs',
|
|
'path',
|
|
'sapper/config/webpack.js',
|
|
'terser-webpack-plugin',
|
|
'webpack',
|
|
'webpack-bundle-analyzer'
|
|
]
|
|
}
|
|
}
|
|
|
|
export default [
|
|
createConfig('./webpack/webpack.config.js'),
|
|
createConfig('./webpack/svelte-intl-loader.js')
|
|
]
|