Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

fix: esm support #110

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ And then use [`vue-tsc`](https://github.com/johnsoncodehk/volar) to do the type

```ts
// vue.config.js
const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default

module.exports = {
parallel: false, // disable thread-loader, which is not compactible with this plugin
configureWebpack: {
plugins: [
require('unplugin-vue2-script-setup/webpack')({ /* options */ }),
ScriptSetup({ /* options */ }),
],
},
}
Expand All @@ -142,11 +143,12 @@ npm i -D @vue/cli-plugin-typescript vue-tsc
```

```ts
const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default
module.exports = {
parallel: false,
configureWebpack: {
plugins: [
require('unplugin-vue2-script-setup/webpack')({ /* options */ }),
ScriptSetup({ /* options */ }),
],
},
chainWebpack(config) {
Expand Down Expand Up @@ -175,10 +177,11 @@ And then use [`vue-tsc`](https://github.com/johnsoncodehk/volar) to do the type

```ts
// webpack.config.js
const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default
module.exports = {
/* ... */
plugins: [
require('unplugin-vue2-script-setup/webpack')({ /* options */ }),
ScriptSetup({ /* options */ }),
]
}
```
Expand Down Expand Up @@ -209,10 +212,11 @@ export default {
```ts
// esbuild.config.js
import { build } from 'esbuild'
import ScriptSetup from 'unplugin-vue2-script-setup/esbuild'
build({
/* ... */
plugins: [
require('unplugin-vue2-script-setup/esbuild')({
ScriptSetup({
/* options */
}),
],
Expand Down
3 changes: 0 additions & 3 deletions src/rollup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import unplugin from '.'

export default unplugin.rollup
module.exports = unplugin.rollup
module.exports.default = unplugin.rollup
Object.defineProperty(module.exports, '__esModule', { value: true })
3 changes: 0 additions & 3 deletions src/vite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import unplugin from '.'

export default unplugin.vite
module.exports = unplugin.vite
module.exports.default = unplugin.vite
Object.defineProperty(module.exports, '__esModule', { value: true })
3 changes: 0 additions & 3 deletions src/webpack.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import unplugin from '.'

export default unplugin.webpack
module.exports = unplugin.webpack
module.exports.default = unplugin.webpack
Object.defineProperty(module.exports, '__esModule', { value: true })