Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
fix: ensure local and production is consistent,fix #27
Browse files Browse the repository at this point in the history
  • Loading branch information
vben-admin committed Aug 1, 2021
1 parent 560b46c commit 896a6fb
Show file tree
Hide file tree
Showing 8 changed files with 1,103 additions and 904 deletions.
4 changes: 2 additions & 2 deletions example/pnp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
"prettier": "^2.3.1",
"typescript": "^4.3.4"
"prettier": "^2.3.2",
"typescript": "^4.3.5"
}
}
18 changes: 9 additions & 9 deletions example/pnp/packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
"serve": "vite preview"
},
"dependencies": {
"antd": "^4.16.5",
"antd": "^4.16.9",
"less": "^4.1.1",
"react": "^17.0.0",
"react-dom": "^17.0.0"
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@vitejs/plugin-react-refresh": "^1.3.1",
"@types/react": "^17.0.15",
"@types/react-dom": "^17.0.9",
"@vitejs/plugin-react-refresh": "^1.3.6",
"cross-env": "^7.0.3",
"typescript": "^4.3.2",
"vite": "^2.3.8",
"vite-plugin-style-import": "^0.7.6"
"typescript": "^4.3.5",
"vite": "^2.4.4",
"vite-plugin-style-import": "^1.0.1"
}
}
20 changes: 10 additions & 10 deletions example/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
"build": "vite build "
},
"dependencies": {
"ant-design-vue": "^2.1.6",
"element-plus": "^1.0.2-beta.44",
"vant": "^3.0.17",
"vue": "^3.0.11"
"ant-design-vue": "^2.2.2",
"element-plus": "^1.0.2-beta.65",
"vant": "^3.1.5",
"vue": "^3.1.5"
},
"devDependencies": {
"@types/rollup": "^0.54.0",
"@vitejs/plugin-vue": "^1.2.2",
"@vitejs/plugin-vue-jsx": "^1.1.4",
"@vue/compiler-sfc": "^3.0.11",
"@vitejs/plugin-vue": "^1.3.0",
"@vitejs/plugin-vue-jsx": "^1.1.7",
"@vue/compiler-sfc": "^3.1.5",
"cross-env": "^7.0.3",
"less": "^4.1.1",
"typescript": "^4.2.4",
"vite": "^2.3.4",
"vite-plugin-style-import": "^0.7.6"
"typescript": "^4.3.5",
"vite": "^2.4.4",
"vite-plugin-style-import": "^1.0.1"
}
}
2 changes: 1 addition & 1 deletion example/vue/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { UserConfigExport } from 'vite';
import vue from '@vitejs/plugin-vue';
import jsx from '@vitejs/plugin-vue-jsx';
import styleImport from '../../src';
import styleImport from '../../dist/index';

export default (): UserConfigExport => {
return {
Expand Down
709 changes: 410 additions & 299 deletions example/vue/yarn.lock

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,39 @@
},
"homepage": "https://github.com/anncwb/vite-plugin-style-import/tree/master/#readme",
"dependencies": {
"@rollup/pluginutils": "^4.1.0",
"@rollup/pluginutils": "^4.1.1",
"change-case": "^4.1.2",
"debug": "^4.3.2",
"es-module-lexer": "^0.6.0",
"es-module-lexer": "^0.7.1",
"magic-string": "^0.25.7"
},
"peerDependencies": {
"vite": ">=2.0.0"
},
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@types/debug": "^4.1.5",
"@types/jest": "^26.0.23",
"@types/node": "^15.12.4",
"@typescript-eslint/eslint-plugin": "^4.28.0",
"@typescript-eslint/parser": "^4.28.0",
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@types/debug": "^4.1.7",
"@types/jest": "^26.0.24",
"@types/node": "^16.4.9",
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.5",
"commitizen": "^4.2.4",
"conventional-changelog-cli": "^2.1.1",
"eslint": "^7.29.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^24.3.6",
"husky": "^6.0.0",
"eslint-plugin-jest": "^24.4.0",
"husky": "^7.0.1",
"ini": "^2.0.0",
"jest": "^27.0.5",
"lint-staged": "^11.0.0",
"jest": "^27.0.6",
"lint-staged": "^11.1.1",
"pinst": "^2.1.6",
"prettier": "^2.3.1",
"prettier": "^2.3.2",
"pretty-quick": "^3.1.1",
"rimraf": "^3.0.2",
"ts-jest": "^27.0.3",
"tsup": "^4.11.2",
"typescript": "^4.3.4",
"vite": "^2.3.8"
"ts-jest": "^27.0.4",
"tsup": "^4.12.5",
"typescript": "^4.3.5",
"vite": "^2.4.4"
}
}
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ export default (options: VitePluginOptions): Plugin => {
// TODO There may be boundary conditions. There is no semicolon ending in the code and the code is connected to one period. But such code should be very bad
const endIndex = se + 1;

if (isBuild) {
str().prependRight(endIndex, `\n${compStrList.join('')}${importCssStrList.join('')}`);
} else {
str().append(`\n${compStrList.join('')}${importCssStrList.join('')}`);
}
// if (isBuild) {
str().prependRight(endIndex, `\n${compStrList.join('')}${importCssStrList.join('')}`);
// } else {
// str().append(`\n${compStrList.join('')}${importCssStrList.join('')}`);
// }

if (isResolveComponent && compNameList.some((item) => importVariables.includes(item))) {
str().remove(ss, endIndex);
Expand Down
Loading

0 comments on commit 896a6fb

Please sign in to comment.