Skip to content

Commit

Permalink
build!: switch to unbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jun 22, 2022
1 parent 86088e4 commit d7bb617
Show file tree
Hide file tree
Showing 4 changed files with 274 additions and 129 deletions.
16 changes: 16 additions & 0 deletions build.config.ts
@@ -0,0 +1,16 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
declaration: true,
rollup: {
emitCJS: true
},
entries: [
{ input: './src/runtime/', outDir: 'dist/runtime', ext: 'js' },
'./src/module'
],
externals: [
'ipx',
'@nuxt/types'
]
})
8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -5,14 +5,14 @@
"repository": "nuxt/image",
"license": "MIT",
"sideEffects": false,
"main": "dist/module.js",
"types": "dist/types.d.ts",
"main": "./dist/module.cjs",
"types": "./dist/module.d.ts",
"files": [
"dist",
"vetur"
],
"scripts": {
"build": "siroc build && mkdist --src src/runtime --dist dist/runtime -d --ext js",
"build": "unbuild",
"dev": "yarn nuxt playground",
"docs:build": "cd docs && nuxt generate",
"docs:dev": "yarn nuxt dev docs",
Expand Down Expand Up @@ -64,10 +64,10 @@
"mkdist": "latest",
"nuxt-edge": "latest",
"playwright": "latest",
"siroc": "latest",
"standard-version": "latest",
"ts-loader": "^8",
"typescript": "latest",
"unbuild": "^0.7.4",
"vue-jest": "latest"
},
"optionalDependencies": {
Expand Down
2 changes: 2 additions & 0 deletions src/module.ts
Expand Up @@ -8,6 +8,8 @@ import { resolveProviders, detectProvider } from './provider'
import { pick, pkg } from './utils'
import type { ModuleOptions, CreateImageOptions } from './types'

export * from './types'

const imageModule: Module<ModuleOptions> = async function imageModule (moduleOptions) {
const { nuxt, addPlugin } = this

Expand Down

0 comments on commit d7bb617

Please sign in to comment.