Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
feat: support build
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Jul 5, 2020
1 parent ee09922 commit 77a989d
Show file tree
Hide file tree
Showing 5 changed files with 1,123 additions and 25 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -27,6 +27,7 @@
"fs-extra": "^9.0.1",
"hash-sum": "^2.0.0",
"prettier": "^2.0.5",
"rollup-plugin-vue": "5.1.9",
"vite": "^1.0.0-beta.8",
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11"
Expand Down
3 changes: 2 additions & 1 deletion playground/package.json
Expand Up @@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"dev": "vite --debug"
"dev": "vite --debug",
"build": "vite build --debug"
},
"author": "",
"license": "ISC",
Expand Down
9 changes: 5 additions & 4 deletions src/index.ts
@@ -1,9 +1,10 @@
import { resolver } from './resolver'
import { vuePlugin } from './serverPlugin'
// import { reactRefreshTransform } from './transform'

export = {
resolvers: [resolver],
configureServer: vuePlugin,
// transforms: [reactRefreshTransform]
resolvers: [resolver],
configureServer: vuePlugin,
rollupInputOptions: {
plugins: [require('rollup-plugin-vue')({})],
},
}
5 changes: 2 additions & 3 deletions src/resolver.ts
Expand Up @@ -2,9 +2,8 @@ import { Resolver } from 'vite'

export const resolver: Resolver = {
alias(id) {
const isProd = process.env.NODE_ENV === 'production'
if (id === 'vue') {
return isProd ? 'vue/dist/vue.runtime.common.js' : 'vue/dist/vue.runtime.esm.js'
return 'vue/dist/vue.runtime.esm.js'
}
}
},
}

0 comments on commit 77a989d

Please sign in to comment.