Skip to content

Commit

Permalink
Merge pull request #1 from 3052971491/dev
Browse files Browse the repository at this point in the history
优化打包
  • Loading branch information
3052971491 authored Sep 22, 2022
2 parents 63bea22 + 5d14cd2 commit e637176
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
7 changes: 4 additions & 3 deletions command/build.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createRequire } from 'module';
import path from "path";
import commonjs from '@rollup/plugin-commonjs';
// import commonjs from '@rollup/plugin-commonjs';
const requireds = createRequire(import.meta.url);
const __dirname = path.resolve();

Expand All @@ -20,11 +20,12 @@ const outDir = path.resolve(__dirname, 'lib');
const rollupOptions = {
target: 'es2015',
// 这两个库不需要打包
external: ['vue', 'ant-design-vue', '@ant-design/icons-vue'],
external: ['vue', 'ant-design-vue', 'vue-json-pretty', '@ant-design/icons-vue'],
output: {
globals: {
vue: 'Vue',
'ant-design-vue': 'ant-design-vue',
'vue-json-pretty': 'vue-json-pretty',
'@ant-design/icons-vue': '@ant-design/icons-vue',
}
},
Expand All @@ -44,9 +45,9 @@ const baseConfig = defineConfig({
configFile: false,
publicDir: false,
plugins: [
commonjs({ requireReturnsDefault: true }),
vue(),
vueJsx(),
// commonjs({ requireReturnsDefault: true }),
],
resolve: {
alias: [
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"doc",
"test"
],
"main": "./lib/mt-form-vue.umd.js",
"module": "./lib/mt-form-vue.es.js",
"main": "./lib/mt-form-vue.umd.cjs",
"module": "./lib/mt-form-vue.js",
"exports": {
".": {
"import": "./lib/mt-form-vue.es.js",
"require": "./lib/mt-form-vue.umd.js"
"import": "./lib/mt-form-vue.js",
"require": "./lib/mt-form-vue.umd.cjs"
}
},
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/components/codemirror/mt-codemirror-editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
nextTick,
PropType,
} from "vue";
import CodeMirror from "codemirror/lib/codemirror.js";
import CodeMirror from "codemirror";
// 主题
import "./codemirror.css";
import "codemirror/theme/idea.css";
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,9 @@ dom-scroll-into-view@^2.0.0:
integrity sha512-bvVTQe1lfaUr1oFzZX80ce9KLDlZ3iU+XGNE/bz9HnGdklTieqsbmsLHe+rT2XWqopvL0PckkYqN7ksmm5pe3w==

electron-to-chromium@^1.4.251:
version "1.4.256"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.256.tgz#c735032f412505e8e0482f147a8ff10cfca45bf4"
integrity sha512-x+JnqyluoJv8I0U9gVe+Sk2st8vF0CzMt78SXxuoWCooLLY2k5VerIBdpvG7ql6GKI4dzNnPjmqgDJ76EdaAKw==
version "1.4.257"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.257.tgz#895dc73c6bb58d1235dc80879ecbca0bcba96e2c"
integrity sha512-C65sIwHqNnPC2ADMfse/jWTtmhZMII+x6ADI9gENzrOiI7BpxmfKFE84WkIEl5wEg+7+SfIkwChDlsd1Erju2A==

errno@^0.1.1:
version "0.1.8"
Expand Down

0 comments on commit e637176

Please sign in to comment.