@dcloudio/vite-plugin-uni 3.0.0-alpha-3030720220111001 → 3.0.0-alpha-3030720220111002

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/uni.js CHANGED
@@ -8,13 +8,7 @@ const filterIndex = process.argv.findIndex((arg) =>
8
8
  if (debugIndex > 0) {
9
9
  let value = process.argv[debugIndex + 1]
10
10
  if (!value || value.startsWith('-')) {
11
- value = 'vite:*'
12
- } else {
13
- // support debugging multiple flags with comma-separated list
14
- value = value
15
- .split(',')
16
- .map((v) => `vite:${v}`)
17
- .join(',')
11
+ value = 'vite:*,uni:*'
18
12
  }
19
13
  process.env.DEBUG = value
20
14
 
@@ -15,7 +15,7 @@ const static_1 = require("./static");
15
15
  const preVue_1 = require("./preVue");
16
16
  const ssr_1 = require("./ssr");
17
17
  const resolveId_1 = require("./resolveId");
18
- const debugPlugin = (0, debug_1.default)('vite:uni:plugin');
18
+ const debugPlugin = (0, debug_1.default)('uni:plugin');
19
19
  const UNI_H5_RE = /@dcloudio\/uni-h5/;
20
20
  const uniPrePluginOptions = {
21
21
  exclude: [...uni_cli_shared_1.COMMON_EXCLUDE, UNI_H5_RE],
@@ -7,7 +7,7 @@ const jsonExtRE = /\.json($|\?)(?!commonjs-proxy)/;
7
7
  const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/;
8
8
  function uniJsonPlugin(options) {
9
9
  return {
10
- name: 'vite:uni-json',
10
+ name: 'uni:json',
11
11
  transform(code, id) {
12
12
  if (!jsonExtRE.test(id))
13
13
  return null;
@@ -8,15 +8,15 @@ const path_1 = __importDefault(require("path"));
8
8
  const debug_1 = __importDefault(require("debug"));
9
9
  const pluginutils_1 = require("@rollup/pluginutils");
10
10
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
11
- const debugPreJs = (0, debug_1.default)('vite:uni:pre-js');
12
- const debugPreHtml = (0, debug_1.default)('vite:uni:pre-html');
13
- const debugPreJsTry = (0, debug_1.default)('vite:uni:pre-js-try');
11
+ const debugPreJs = (0, debug_1.default)('uni:pre-js');
12
+ const debugPreHtml = (0, debug_1.default)('uni:pre-html');
13
+ const debugPreJsTry = (0, debug_1.default)('uni:pre-js-try');
14
14
  const PRE_JS_EXTNAME = ['.json', '.css'].concat(uni_cli_shared_1.EXTNAME_VUE).concat(uni_cli_shared_1.EXTNAME_JS);
15
15
  const PRE_HTML_EXTNAME = uni_cli_shared_1.EXTNAME_VUE;
16
16
  function uniPrePlugin(config, options) {
17
17
  const filter = (0, pluginutils_1.createFilter)(options.include, options.exclude);
18
18
  return {
19
- name: 'vite:uni-pre',
19
+ name: 'uni:pre',
20
20
  transform(code, id) {
21
21
  if (!filter(id)) {
22
22
  return;
@@ -7,8 +7,8 @@ exports.uniPreCssPlugin = void 0;
7
7
  const debug_1 = __importDefault(require("debug"));
8
8
  const pluginutils_1 = require("@rollup/pluginutils");
9
9
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
10
- const debugPre = (0, debug_1.default)('vite:uni:pre-css');
11
- const debugPreTry = (0, debug_1.default)('vite:uni:pre-css-try');
10
+ const debugPre = (0, debug_1.default)('uni:pre-css');
11
+ const debugPreTry = (0, debug_1.default)('uni:pre-css-try');
12
12
  const cssLangs = `\\.(css|less|sass|scss|styl|stylus|postcss)($|\\?)`;
13
13
  const cssLangRE = new RegExp(cssLangs);
14
14
  /**
@@ -18,7 +18,7 @@ const cssLangRE = new RegExp(cssLangs);
18
18
  function uniPreCssPlugin(config, options) {
19
19
  const filter = (0, pluginutils_1.createFilter)(options.include, options.exclude);
20
20
  return {
21
- name: 'vite:uni-pre-css',
21
+ name: 'uni:pre-css',
22
22
  transform(code, id) {
23
23
  if (!cssLangRE.test(id)) {
24
24
  return;
@@ -8,13 +8,13 @@ const path_1 = __importDefault(require("path"));
8
8
  const debug_1 = __importDefault(require("debug"));
9
9
  const compiler_sfc_1 = require("@vue/compiler-sfc");
10
10
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
11
- const debugPreVue = (0, debug_1.default)('vite:uni:pre-vue');
11
+ const debugPreVue = (0, debug_1.default)('uni:pre-vue');
12
12
  const BLOCK_RE = /<\/block>/;
13
13
  const WXS_LANG_RE = /lang=["|'](renderjs|wxs)["|']/;
14
14
  const WXS_ATTRS = ['wxs', 'renderjs'];
15
15
  function uniPreVuePlugin() {
16
16
  return {
17
- name: 'vite:uni-pre-vue',
17
+ name: 'uni:pre-vue',
18
18
  async transform(code, id) {
19
19
  const { filename, query } = (0, uni_cli_shared_1.parseVueRequest)(id);
20
20
  if (query.vue) {
@@ -7,7 +7,7 @@ exports.uniResolveIdPlugin = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const debug_1 = __importDefault(require("debug"));
9
9
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
10
- const debugResolve = (0, debug_1.default)('vite:uni:resolve');
10
+ const debugResolve = (0, debug_1.default)('uni:resolve-id');
11
11
  const BUILT_IN_MODULES = {
12
12
  'vue-router': 'dist/vue-router.esm-bundler.js',
13
13
  vuex: 'dist/vuex.esm-bundler.js',
@@ -21,7 +21,7 @@ const BUILT_IN_MODULES = {
21
21
  function uniResolveIdPlugin(options) {
22
22
  const resolveCache = {};
23
23
  return {
24
- name: 'vite:uni-resolve-id',
24
+ name: 'uni:resolve-id',
25
25
  resolveId(id) {
26
26
  const cache = resolveCache[id];
27
27
  if (cache) {
@@ -10,12 +10,12 @@ const estree_walker_1 = require("estree-walker");
10
10
  const pluginutils_1 = require("@rollup/pluginutils");
11
11
  const compiler_sfc_1 = require("@vue/compiler-sfc");
12
12
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
13
- const debugSSR = (0, debug_1.default)('vite:uni:ssr');
13
+ const debugSSR = (0, debug_1.default)('uni:ssr');
14
14
  const KEYED_FUNC_RE = /(ssrRef|shallowSsrRef)/;
15
15
  function uniSSRPlugin(config, options) {
16
16
  const filter = (0, pluginutils_1.createFilter)(options.include, options.exclude);
17
17
  return {
18
- name: 'vite:uni-ssr',
18
+ name: 'uni:ssr',
19
19
  transform(code, id) {
20
20
  if (!filter(id))
21
21
  return null;
@@ -7,7 +7,7 @@ exports.uniStaticPlugin = void 0;
7
7
  const debug_1 = __importDefault(require("debug"));
8
8
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
9
9
  const utils_1 = require("../../utils");
10
- const debugStatic = (0, debug_1.default)('vite:uni:static');
10
+ const debugStatic = (0, debug_1.default)('uni:static');
11
11
  /**
12
12
  * 提供static等目录静态资源加载
13
13
  * @param _options
@@ -17,7 +17,7 @@ const debugStatic = (0, debug_1.default)('vite:uni:static');
17
17
  function uniStaticPlugin(_options, config) {
18
18
  const filter = (0, utils_1.createPublicFileFilter)();
19
19
  return {
20
- name: 'vite:uni-static',
20
+ name: 'uni:static',
21
21
  resolveId(id) {
22
22
  if (!config.assetsInclude((0, uni_cli_shared_1.cleanUrl)(id))) {
23
23
  return;
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ const copy_1 = require("./plugins/copy");
17
17
  const utils_1 = require("./utils");
18
18
  const vue_1 = require("./vue");
19
19
  // import { createResolveId } from './resolveId'
20
- const debugUni = (0, debug_1.default)('vite:uni:plugin');
20
+ const debugUni = (0, debug_1.default)('uni:plugin');
21
21
  const pkg = require(path_1.default.resolve(__dirname, '../package.json'));
22
22
  (0, uni_cli_shared_1.initModuleAlias)();
23
23
  (0, utils_1.rewriteCompilerSfcParse)();
@@ -53,7 +53,7 @@ function uniPlugin(rawOptions = {}) {
53
53
  plugins.push((0, plugin_vue_jsx_1.default)((0, vue_1.initPluginVueJsxOptions)(options, uniPluginOptions.compilerOptions, uniPluginOptions.jsxOptions)));
54
54
  }
55
55
  plugins.push({
56
- name: 'vite:uni',
56
+ name: 'uni',
57
57
  config: (0, config_1.createConfig)(options, uniPlugins),
58
58
  // resolveId: createResolveId(options),
59
59
  configResolved: (0, configResolved_1.createConfigResolved)(options),
@@ -8,7 +8,7 @@ const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const debug_1 = __importDefault(require("debug"));
10
10
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
11
- const debugCopy = (0, debug_1.default)('vite:uni:copy');
11
+ const debugCopy = (0, debug_1.default)('uni:copy');
12
12
  function uniCopyPlugin({ outputDir, copyOptions, }) {
13
13
  const staticDir = uni_cli_shared_1.PUBLIC_DIR + '/**/*';
14
14
  const uniModulesStaticDir = 'uni_modules/*/' + uni_cli_shared_1.PUBLIC_DIR + '/**/*';
@@ -7,7 +7,7 @@ exports.initEasycom = void 0;
7
7
  const debug_1 = __importDefault(require("debug"));
8
8
  const uni_shared_1 = require("@dcloudio/uni-shared");
9
9
  const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared");
10
- const debugEasycom = (0, debug_1.default)('vite:uni:easycom');
10
+ const debugEasycom = (0, debug_1.default)('uni:easycom');
11
11
  const initEasycom = (watcher) => {
12
12
  const { filter, refresh, options } = (0, uni_cli_shared_1.initEasycomsOnce)(process.env.UNI_INPUT_DIR, {
13
13
  dirs: [(0, uni_cli_shared_1.resolveComponentsLibPath)()],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vite-plugin-uni",
3
- "version": "3.0.0-alpha-3030720220111001",
3
+ "version": "3.0.0-alpha-3030720220111002",
4
4
  "description": "uni-app vite plugin",
5
5
  "bin": {
6
6
  "uni": "bin/uni.js"
@@ -25,8 +25,8 @@
25
25
  "@babel/core": "^7.16.5",
26
26
  "@babel/plugin-syntax-import-meta": "^7.10.4",
27
27
  "@babel/plugin-transform-typescript": "^7.16.1",
28
- "@dcloudio/uni-cli-shared": "3.0.0-alpha-3030720220111001",
29
- "@dcloudio/uni-shared": "3.0.0-alpha-3030720220111001",
28
+ "@dcloudio/uni-cli-shared": "3.0.0-alpha-3030720220111002",
29
+ "@dcloudio/uni-shared": "3.0.0-alpha-3030720220111002",
30
30
  "@rollup/pluginutils": "^4.1.2",
31
31
  "@vitejs/plugin-legacy": "^1.6.4",
32
32
  "@vitejs/plugin-vue": "^2.0.1",