|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
-
- var _chunkOZQFJBTFjs = require('./chunk-OZQFJBTF.js');
-
- // src/index.ts
- var _unplugin = require('unplugin');
-
-
-
-
-
-
- var _common = require('@vue-macros/common');
- var _api = require('@vue-macros/api');
- function resolveOption(options, framework) {
- const version = options.version || _common.detectVueVersion.call(void 0, );
- return {
- include: [_common.REGEX_VUE_SFC, _common.REGEX_SETUP_SFC].concat(
- version === 2 && framework === "webpack" ? _common.REGEX_VUE_SUB : []
- ),
- isProduction: process.env.NODE_ENV === "production",
- ...options,
- version
- };
- }
- var name = "unplugin-vue-single-define";
- var src_default = _unplugin.createUnplugin.call(void 0,
- (userOptions = {}, { framework }) => {
- const options = resolveOption(userOptions, framework);
- const filter = _common.createFilter.call(void 0, options);
- const { resolve, handleHotUpdate } = _api.RollupResolve.call(void 0, );
- return {
- name,
- enforce: "pre",
- buildStart() {
- if (framework === "rollup" || framework === "vite") {
- _api.setResolveTSFileIdImpl.call(void 0, resolve(this));
- }
- },
- transformInclude(id) {
- return filter(id);
- },
- transform(code, id) {
- return _chunkOZQFJBTFjs.transformDefineSingle.call(void 0, code, id, options.isProduction);
- },
- vite: {
- configResolved(config) {
- options.isProduction = config.isProduction;
- },
- handleHotUpdate
- }
- };
- }
- );
-
-
-
- exports.src_default = src_default;
|