Skip to content

Commit

Permalink
fix: cloudflare and polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 20, 2020
1 parent 9ba1281 commit dc967bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/presets/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export const cloudflare: SigmaPreset = extendPreset(worker, {
async 'sigma:compiled' ({ output, _nuxt }: SigmaContext) {
await writeFile(resolve(output.dir, 'package.json'), JSON.stringify({ private: true, main: './server/index.js' }, null, 2))
await writeFile(resolve(output.dir, 'package-lock.json'), JSON.stringify({ lockfileVersion: 1 }, null, 2))
consola.success('Ready to run `wrangler publish` in', prettyPath(_nuxt.rootDir))
let inDir = prettyPath(_nuxt.rootDir)
if (inDir) {
inDir = 'in ' + inDir
}
consola.success('Ready to run `wrangler publish`', inDir)
}
}
})
2 changes: 1 addition & 1 deletion src/rollup/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const getRollupConfig = (sigmaContext: SigmaContext) => {

// Polyfill
rollupConfig.plugins.push(virtual({
'~polyfill': env.polyfill.map(p => `require('${p}');`).join('\n')
'~polyfill': env.polyfill.map(p => `import '${p}';`).join('\n')
}))

// https://github.com/rollup/plugins/tree/master/packages/alias
Expand Down

0 comments on commit dc967bc

Please sign in to comment.