Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: imports support, webpack upgrade #672

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"vue": "^2.5.17",
"vue-server-renderer": "^2.5.17",
"web-vitals": "^0.2.4",
"webpack": "5.26.3",
"webpack": "5.27.1",
"when": "^3.7.8"
},
"resolutions": {
Expand Down
2 changes: 2 additions & 0 deletions test/unit/imports/input.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { x } from '#x';
console.log(x);
1 change: 1 addition & 0 deletions test/unit/imports/no.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export var y = 'y';
1 change: 1 addition & 0 deletions test/unit/imports/node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export var x = 'x';
34 changes: 34 additions & 0 deletions test/unit/imports/output-coverage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __nccwpck_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __nccwpck_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__nccwpck_require__.r(__webpack_exports__);

;// CONCATENATED MODULE: ./test/unit/imports/node.js
var x = 'x';

;// CONCATENATED MODULE: ./test/unit/imports/input.js

console.log(x);

module.exports = __webpack_exports__;
/******/ })()
;
34 changes: 34 additions & 0 deletions test/unit/imports/output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ // The require scope
/******/ var __nccwpck_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __nccwpck_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/compat */
/******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__nccwpck_require__.r(__webpack_exports__);

;// CONCATENATED MODULE: ./test/unit/imports/node.js
var x = 'x';

;// CONCATENATED MODULE: ./test/unit/imports/input.js

console.log(x);

module.exports = __webpack_exports__;
/******/ })()
;
12 changes: 12 additions & 0 deletions test/unit/imports/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "x",
"type": "module",
"imports": {
"#x": {
"module": "./no.js",
"default": {
"node": "./node.js"
}
}
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15008,10 +15008,10 @@ webpack-sources@^2.1.1:
source-list-map "^2.0.1"
source-map "^0.6.1"

webpack@5.26.3:
version "5.26.3"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.26.3.tgz#bafd439abac08fbb82657ec855d038743b725ab8"
integrity sha512-z/F2lt2N1fZqaud1B4SzjL3OW03eULThbBXQ2OX4LSrZX4N9k1A5d0Rje3zS2g887DTWyAV0KGqEf64ois2dhg==
webpack@5.27.1:
version "5.27.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.27.1.tgz#6808fb6e45e35290cdb8ae43c7a10884839a3079"
integrity sha512-rxIDsPZ3Apl3JcqiemiLmWH+hAq04YeOXqvCxNZOnTp8ZgM9NEPtbu4CaMfMEf9KShnx/Ym8uLGmM6P4XnwCoA==
dependencies:
"@types/eslint-scope" "^3.7.0"
"@types/estree" "^0.0.46"
Expand Down