Skip to content

Commit

Permalink
chore: update rollup (#12537)
Browse files Browse the repository at this point in the history
* chore: update dependencies

* chore: update lock

* fix: update snapshot
  • Loading branch information
Chen-jj authored Sep 21, 2022
1 parent 3e01d05 commit 70096bd
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 77 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"react-dom": "^18",
"react-test-renderer": "^18",
"rimraf": "^3.0.0",
"rollup": "^2.56.2",
"rollup": "^2.79.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-node-externals": "^4.0.0",
"rollup-plugin-postcss": "^3.1.8",
Expand Down
3 changes: 2 additions & 1 deletion packages/taro-plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"url": "https://github.com/NervJS/taro/issues"
},
"dependencies": {
"@tarojs/runtime": "workspace:*",
"@tarojs/helper": "workspace:*",
"@tarojs/runtime": "workspace:*",
"@tarojs/service": "workspace:*",
"@tarojs/shared": "workspace:*",
"acorn": "^8.0.4",
Expand All @@ -37,6 +37,7 @@
"@prefresh/babel-plugin": "^0.4.1",
"@prefresh/core": "^1.3.4",
"@prefresh/webpack": "^3.2.3",
"preact": "^10.10.0",
"react-refresh": "^0.11.0"
},
"peerDependencies": {
Expand Down
14 changes: 8 additions & 6 deletions packages/taro-plugin-vue2/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { getLoaderMeta } from './loader-meta'

import type { IPluginContext } from '@tarojs/service'

const CUSTOM_WRAPPER = 'custom-wrapper'
export const CUSTOM_WRAPPER = 'custom-wrapper'

let isBuildH5

export default (ctx: IPluginContext) => {
Expand All @@ -33,18 +34,19 @@ export default (ctx: IPluginContext) => {

if (!opts?.compiler) return

// 提供给 webpack5 依赖预编译收集器的第三方依赖
const deps = [
'vue',
'@tarojs/plugin-framework-vue2/dist/runtime'
]
if (isString(opts.compiler)) {
opts.compiler = {
type: opts.compiler
}
}

const { compiler } = opts
if (compiler.type === 'webpack5') {
// 提供给 webpack5 依赖预编译收集器的第三方依赖
const deps = [
'vue',
'@tarojs/plugin-framework-vue2/dist/runtime'
]
compiler.prebundle ||= {}
const prebundleOptions = compiler.prebundle
prebundleOptions.include ||= []
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-plugin-vue2/src/loader-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const App = {
importFrameworkName: 'Vue',
isNeedRawLoader: true,
extraImportForWeb: `
require('@tarojs/components/dist-h5/vue')
import('@tarojs/components/dist-h5/vue')
`
}
}
11 changes: 6 additions & 5 deletions packages/taro-plugin-vue3/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,19 @@ export default (ctx: IPluginContext, config: IConfig = {}) => {

if (!opts?.compiler) return

// 提供给 webpack5 依赖预编译收集器的第三方依赖
const deps = [
'vue',
'@tarojs/plugin-framework-vue3/dist/runtime'
]
if (isString(opts.compiler)) {
opts.compiler = {
type: opts.compiler
}
}

const { compiler } = opts
if (compiler.type === 'webpack5') {
// 提供给 webpack5 依赖预编译收集器的第三方依赖
const deps = [
'vue',
'@tarojs/plugin-framework-vue3/dist/runtime'
]
compiler.prebundle ||= {}
const prebundleOptions = compiler.prebundle
prebundleOptions.include ||= []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ exports[`vue should build vue app 2`] = `
var _defineProperty = __webpack_require__(11).default;
var _slicedToArray = __webpack_require__(12).default;
var _createForOfIteratorHelper = __webpack_require__(16).default;
var _typeof = __webpack_require__(3).default;
var _typeof = __webpack_require__(2).default;
var _toConsumableArray = __webpack_require__(17).default;
var strictUriEncode = __webpack_require__(21);
var decodeComponent = __webpack_require__(22);
Expand Down Expand Up @@ -689,22 +689,6 @@ exports[`vue should build vue app 2`] = `
};
return exports.pick(input, exclusionFilter, options);
};
}, function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, \\"defineCustomElements\\", (function() {
return defineCustomElements;
}));
__webpack_require__.d(__webpack_exports__, \\"applyPolyfills\\", (function() {
return applyPolyfills;
}));
__webpack_require__.d(__webpack_exports__, \\"initVue3Components\\", (function() {
return initVue3Components;
}));
__webpack_exports__[\\"default\\"] = \\"taro-components-mock\\";
function defineCustomElements() {}
function applyPolyfills() {}
function initVue3Components() {}
}, function(module, exports, __webpack_require__) {
var arrayLikeToArray = __webpack_require__(7);
function _unsupportedIterableToArray(o, minLen) {
Expand All @@ -729,7 +713,7 @@ exports[`vue should build vue app 2`] = `
}
module.exports = _typeof, module.exports.__esModule = true, module.exports[\\"default\\"] = module.exports;
}, function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__(3).default;
var _typeof = __webpack_require__(2).default;
module.exports = pathToRegexp;
module.exports.match = match;
module.exports.regexpToFunction = regexpToFunction;
Expand Down Expand Up @@ -962,6 +946,22 @@ exports[`vue should build vue app 2`] = `
}
return stringToRegexp(path, keys, options);
}
}, function(module, __webpack_exports__, __webpack_require__) {
\\"use strict\\";
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, \\"defineCustomElements\\", (function() {
return defineCustomElements;
}));
__webpack_require__.d(__webpack_exports__, \\"applyPolyfills\\", (function() {
return applyPolyfills;
}));
__webpack_require__.d(__webpack_exports__, \\"initVue3Components\\", (function() {
return initVue3Components;
}));
__webpack_exports__[\\"default\\"] = \\"taro-components-mock\\";
function defineCustomElements() {}
function applyPolyfills() {}
function initVue3Components() {}
}, function(module, exports, __webpack_require__) {
\\"use strict\\";
var isOldIE = function isOldIE() {
Expand Down Expand Up @@ -1779,7 +1779,7 @@ exports[`vue should build vue app 2`] = `
}, function(module, exports, __webpack_require__) {
var arrayWithHoles = __webpack_require__(13);
var iterableToArrayLimit = __webpack_require__(14);
var unsupportedIterableToArray = __webpack_require__(2);
var unsupportedIterableToArray = __webpack_require__(1);
var nonIterableRest = __webpack_require__(15);
function _slicedToArray(arr, i) {
return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
Expand Down Expand Up @@ -1822,7 +1822,7 @@ exports[`vue should build vue app 2`] = `
}
module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\\"default\\"] = module.exports;
}, function(module, exports, __webpack_require__) {
var unsupportedIterableToArray = __webpack_require__(2);
var unsupportedIterableToArray = __webpack_require__(1);
function _createForOfIteratorHelper(o, allowArrayLike) {
var it = typeof Symbol !== \\"undefined\\" && o[Symbol.iterator] || o[\\"@@iterator\\"];
if (!it) {
Expand Down Expand Up @@ -1876,7 +1876,7 @@ exports[`vue should build vue app 2`] = `
}, function(module, exports, __webpack_require__) {
var arrayWithoutHoles = __webpack_require__(18);
var iterableToArray = __webpack_require__(19);
var unsupportedIterableToArray = __webpack_require__(2);
var unsupportedIterableToArray = __webpack_require__(1);
var nonIterableSpread = __webpack_require__(20);
function _toConsumableArray(arr) {
return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
Expand Down Expand Up @@ -1907,7 +1907,7 @@ exports[`vue should build vue app 2`] = `
};
}, function(module, exports, __webpack_require__) {
\\"use strict\\";
var _typeof = __webpack_require__(3).default;
var _typeof = __webpack_require__(2).default;
var token = \\"%[a-f0-9]{2}\\";
var singleMatcher = new RegExp(token, \\"gi\\");
var multiMatcher = new RegExp(\\"(\\" + token + \\")+\\", \\"gi\\");
Expand Down Expand Up @@ -3868,7 +3868,7 @@ exports[`vue should build vue app 2`] = `
}), _callee, null, [ [ 7, 14 ] ]);
})));
}
var path_to_regexp = __webpack_require__(4);
var path_to_regexp = __webpack_require__(3);
var path_to_regexp_default = __webpack_require__.n(path_to_regexp);
var module_hasOwnProperty = Object.prototype.hasOwnProperty;
var cache = new Map;
Expand Down Expand Up @@ -4644,7 +4644,7 @@ exports[`vue should build vue app 2`] = `
function taro_framework_createReactApp() {}
function taro_framework_createVueApp() {}
function taro_framework_createVue3App() {}
var taro_components = __webpack_require__(1);
var taro_components = __webpack_require__(4);
var mocks_taro_components = __webpack_require__(27);
var app_config_config = {
\\"router\\": {
Expand All @@ -4660,7 +4660,7 @@ exports[`vue should build vue app 2`] = `
\\"navigationBarTextStyle\\": \\"black\\"
}
};
__webpack_require__(1);
Promise.resolve().then(__webpack_require__.bind(null, 4));
Object(taro_components[\\"applyPolyfills\\"])().then((function() {
Object(taro_components[\\"defineCustomElements\\"])(taro_runtime_window);
}));
Expand Down
Loading

0 comments on commit 70096bd

Please sign in to comment.