Skip to content

Commit

Permalink
fix: don't import core-js polyfill in server build (#353)
Browse files Browse the repository at this point in the history
* feat: add server plugin

* Remove separate plugin
  • Loading branch information
charlie0228 authored Jan 23, 2021
1 parent 3e02dde commit 2755d6b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions templates/plugin.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<% if (options.corejsPolyfill === '3') { %>
// Necessary polyfill for Composition API support for IE11
import 'core-js/features/reflect/own-keys'
<% } else if (options.corejsPolyfill === '2') { %>
// Necessary polyfill for Composition API support for IE11
import 'core-js/modules/es6.reflect.own-keys'
<% } %>
if (process.client) {
<% if (options.corejsPolyfill === '3') { %>
// Necessary polyfill for Composition API support for IE11
require('core-js/features/reflect/own-keys')
<% } else if (options.corejsPolyfill === '2') { %>
// Necessary polyfill for Composition API support for IE11
require('core-js/modules/es6.reflect.own-keys')
<% } %>
}

import { globalPlugin } from '@nuxtjs/composition-api'

Expand Down

1 comment on commit 2755d6b

@vercel
Copy link

@vercel vercel bot commented on 2755d6b Jan 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.