auto commit
This commit is contained in:
parent
de57a355b9
commit
65149c88e1
@ -4,3 +4,4 @@ this.c = 'c';
|
||||
module.exports = {
|
||||
d: 'd',
|
||||
};
|
||||
|
||||
|
||||
@ -3,3 +3,4 @@ export { count };
|
||||
export function increase() {
|
||||
count++;
|
||||
}
|
||||
|
||||
|
||||
@ -10,3 +10,4 @@
|
||||
<script src="./index.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@ -5,3 +5,4 @@ increase();
|
||||
console.log(count);
|
||||
console.log(counter.count);
|
||||
console.log(c);
|
||||
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
const m = require('./1');
|
||||
console.log(m);
|
||||
|
||||
|
||||
@ -134,3 +134,4 @@ console.log(a); // 2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2
02. npx/proj1/dist/main.js
vendored
2
02. npx/proj1/dist/main.js
vendored
@ -1 +1 @@
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log(123)}]);
|
||||
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){console.log(123)}]);
|
||||
|
||||
@ -1 +1,2 @@
|
||||
console.log(123);
|
||||
|
||||
|
||||
2
02. npx/proj2/dist/main.js
vendored
2
02. npx/proj2/dist/main.js
vendored
@ -1 +1 @@
|
||||
console.log(123);
|
||||
console.log(123);
|
||||
|
||||
@ -1 +1,2 @@
|
||||
console.log(123);
|
||||
|
||||
|
||||
@ -44,3 +44,4 @@ npm init @命名空间 # 等效于 npx @命名空间/create
|
||||
npm init @命名空间/包名 # 等效于 npx @命名空间/create-包名
|
||||
```
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
module.exports = {
|
||||
extends: 'airbnb',
|
||||
};
|
||||
|
||||
|
||||
@ -3,3 +3,4 @@ let a = 1;
|
||||
if (a === 1) {
|
||||
a *= 2;
|
||||
}
|
||||
|
||||
|
||||
@ -3,3 +3,4 @@ module.exports = {
|
||||
eqeqeq: 'error',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -2,3 +2,4 @@ var a = 1;
|
||||
|
||||
if (a == 1) {
|
||||
}
|
||||
|
||||
|
||||
@ -15,3 +15,4 @@ module.exports = {
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -22,3 +22,4 @@ npm run lint
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
|
||||
|
||||
@ -3,3 +3,4 @@ module.exports = {
|
||||
'@vue/cli-plugin-babel/preset',
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@ -15,3 +15,4 @@
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@ -26,3 +26,4 @@ export default {
|
||||
margin-top: 60px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -56,3 +56,4 @@ a {
|
||||
color: #42b983;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -6,3 +6,4 @@ Vue.config.productionTip = false;
|
||||
new Vue({
|
||||
render: (h) => h(App),
|
||||
}).$mount('#app');
|
||||
|
||||
|
||||
@ -118,4 +118,4 @@ module.exports = {
|
||||
我们要做什么?
|
||||
|
||||
- 安装好VSCode的ESLint插件
|
||||
- 学会查看ESLint错误提示
|
||||
- 学会查看ESLint错误提示
|
||||
|
||||
@ -25,3 +25,4 @@ webpack的版本会不断更新,但它的核心原理是不变的,因此,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
05. webpack scope hoisting/demo/dist/main.js
vendored
1
05. webpack scope hoisting/demo/dist/main.js
vendored
@ -62,3 +62,4 @@
|
||||
for (let e = 1; e < 20; e++) console.log(n(1, 10));
|
||||
},
|
||||
]);
|
||||
|
||||
|
||||
@ -3,3 +3,4 @@ import { getRandom } from './module';
|
||||
for (let i = 1; i < 20; i++) {
|
||||
console.log(getRandom(1, 10));
|
||||
}
|
||||
|
||||
|
||||
@ -2,3 +2,4 @@ export function getRandom(min, max) {
|
||||
const n = Math.random() * (max - min);
|
||||
return Math.floor(n) + min;
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
module.exports = {
|
||||
devtool: 'none',
|
||||
};
|
||||
|
||||
|
||||
@ -16,4 +16,4 @@
|
||||
>
|
||||
> 这样做的好处是减少了函数调用,对运行效率有一定提升,同时也降低了打包体积。
|
||||
>
|
||||
> 但 scope hoisting 的启用是有前提的,如果遇到某些模块多次被其他模块引用,或者使用了动态导入的模块,或者是非 ESM 的模块,都不会有 scope hoisting。
|
||||
> 但 scope hoisting 的启用是有前提的,如果遇到某些模块多次被其他模块引用,或者使用了动态导入的模块,或者是非 ESM 的模块,都不会有 scope hoisting。
|
||||
|
||||
@ -220,3 +220,4 @@
|
||||
/******/
|
||||
})();
|
||||
//# sourceMappingURL=main.js.map
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
const resp = await fetch("http://www.baidu.com");
|
||||
const jsonBody = await resp.json();
|
||||
export default jsonBody;
|
||||
|
||||
|
||||
@ -6,3 +6,4 @@ module.exports = {
|
||||
topLevelAwait: true,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
2
06. webpack5更新了什么/打包体积优化/dist/index1.js
vendored
2
06. webpack5更新了什么/打包体积优化/dist/index1.js
vendored
@ -1,2 +1,2 @@
|
||||
console.log("index1.js没有依赖其他模块,也没有导出任何东西");
|
||||
//# sourceMappingURL=index1.js.map
|
||||
//# sourceMappingURL=index1.js.map
|
||||
|
||||
1
06. webpack5更新了什么/打包体积优化/dist/index2.js
vendored
1
06. webpack5更新了什么/打包体积优化/dist/index2.js
vendored
@ -3,3 +3,4 @@
|
||||
console.log('f1'), console.log('f4');
|
||||
})();
|
||||
//# sourceMappingURL=index2.js.map
|
||||
|
||||
|
||||
@ -1 +1,2 @@
|
||||
console.log("index1.js没有依赖其他模块,也没有导出任何东西");
|
||||
|
||||
|
||||
@ -2,3 +2,4 @@ import { f1 } from './modules/a';
|
||||
import * as bFuncs from './modules/b';
|
||||
f1();
|
||||
bFuncs.f4();
|
||||
|
||||
|
||||
@ -7,3 +7,4 @@ export function f2() {
|
||||
console.log('f2');
|
||||
f3();
|
||||
}
|
||||
|
||||
|
||||
@ -5,3 +5,4 @@ export function f3() {
|
||||
export function f4() {
|
||||
console.log("f4");
|
||||
}
|
||||
|
||||
|
||||
@ -6,3 +6,4 @@ module.exports = {
|
||||
index2: "./src/index2.js",
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
2
06. webpack5更新了什么/打包缓存/dist/main.js
vendored
2
06. webpack5更新了什么/打包缓存/dist/main.js
vendored
@ -38711,4 +38711,4 @@ console.log((lodash__WEBPACK_IMPORTED_MODULE_0___default()), (moment__WEBPACK_IM
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=main.js.map
|
||||
//# sourceMappingURL=main.js.map
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
console.log(_, moment);
|
||||
|
||||
|
||||
@ -10,3 +10,4 @@ module.exports = {
|
||||
// 更多配置参考:https://webpack.docschina.org/configuration/other-options/#cache
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
1
06. webpack5更新了什么/清除输出目录/dist/main.js
vendored
1
06. webpack5更新了什么/清除输出目录/dist/main.js
vendored
@ -0,0 +1 @@
|
||||
|
||||
@ -0,0 +1 @@
|
||||
|
||||
@ -4,3 +4,4 @@ module.exports = {
|
||||
clean: true,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -65,4 +65,4 @@ module.exports = {
|
||||
|
||||
由于大部分前端项目都会用到资源型文件,因此`webpack5`原生支持了资源型模块
|
||||
|
||||
详见:https://webpack.docschina.org/guides/asset-modules/
|
||||
详见:https://webpack.docschina.org/guides/asset-modules/
|
||||
|
||||
2
06. webpack5更新了什么/资源模块/dist/index.html
vendored
2
06. webpack5更新了什么/资源模块/dist/index.html
vendored
@ -6,4 +6,4 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="main.js"></script></head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
2
06. webpack5更新了什么/资源模块/dist/main.js
vendored
2
06. webpack5更新了什么/资源模块/dist/main.js
vendored
@ -138,4 +138,4 @@ console.log('raw.txt', _assets_raw_txt__WEBPACK_IMPORTED_MODULE_3__);
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=main.js.map
|
||||
//# sourceMappingURL=main.js.map
|
||||
|
||||
@ -7,3 +7,4 @@ console.log('big-pic.png', bigPic);
|
||||
console.log('small-pic.jpg', smallPic);
|
||||
console.log('yueyunpeng.gif', yueyunpeng);
|
||||
console.log('raw.txt', raw);
|
||||
|
||||
|
||||
@ -42,3 +42,4 @@ module.exports = {
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -19,4 +19,4 @@
|
||||
>
|
||||
> # 设置缓存位置
|
||||
> npm config set cache "新的缓存路径"
|
||||
> ```
|
||||
> ```
|
||||
|
||||
1
08. 模块联邦/demo/active/src/bootstrap.js
vendored
1
08. 模块联邦/demo/active/src/bootstrap.js
vendored
@ -10,3 +10,4 @@ now($('<div>').appendTo(document.body));
|
||||
|
||||
// 活动页中有一个新闻列表
|
||||
news($('<div>').appendTo(document.body));
|
||||
|
||||
|
||||
@ -1 +1,2 @@
|
||||
import('./bootstrap');
|
||||
|
||||
|
||||
@ -8,3 +8,4 @@ export default function (container) {
|
||||
}
|
||||
ul.html(html);
|
||||
}
|
||||
|
||||
|
||||
@ -42,3 +42,4 @@ module.exports = {
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
2
08. 模块联邦/demo/home/dist/home-entry.js
vendored
2
08. 模块联邦/demo/home/dist/home-entry.js
vendored
@ -305,4 +305,4 @@ __webpack_require__.d(exports, {
|
||||
home = __webpack_exports__;
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=home-entry.js.map
|
||||
//# sourceMappingURL=home-entry.js.map
|
||||
|
||||
2
08. 模块联邦/demo/home/dist/index.html
vendored
2
08. 模块联邦/demo/home/dist/index.html
vendored
@ -6,4 +6,4 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"><script defer src="main.js"></script><script defer src="home-entry.js"></script></head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
2
08. 模块联邦/demo/home/dist/main.js
vendored
2
08. 模块联邦/demo/home/dist/main.js
vendored
@ -268,4 +268,4 @@ Promise.all(/*! import() */[__webpack_require__.e("vendors-node_modules_jquery_d
|
||||
|
||||
/******/ })()
|
||||
;
|
||||
//# sourceMappingURL=main.js.map
|
||||
//# sourceMappingURL=main.js.map
|
||||
|
||||
2
08. 模块联邦/demo/home/dist/src_bootstrap_js.js
vendored
2
08. 模块联邦/demo/home/dist/src_bootstrap_js.js
vendored
@ -48,4 +48,4 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
//# sourceMappingURL=src_bootstrap_js.js.map
|
||||
//# sourceMappingURL=src_bootstrap_js.js.map
|
||||
|
||||
2
08. 模块联邦/demo/home/dist/src_now_js.js
vendored
2
08. 模块联邦/demo/home/dist/src_now_js.js
vendored
@ -26,4 +26,4 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
//# sourceMappingURL=src_now_js.js.map
|
||||
//# sourceMappingURL=src_now_js.js.map
|
||||
|
||||
1
08. 模块联邦/demo/home/src/bootstrap.js
vendored
1
08. 模块联邦/demo/home/src/bootstrap.js
vendored
@ -10,3 +10,4 @@ now($('<div>').appendTo(document.body));
|
||||
|
||||
// 新闻列表
|
||||
news($('<div>').appendTo(document.body));
|
||||
|
||||
|
||||
@ -1 +1,2 @@
|
||||
import('./bootstrap');
|
||||
|
||||
|
||||
@ -6,3 +6,4 @@ export default function (container) {
|
||||
p.text(new Date().toLocaleString());
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
@ -41,3 +41,4 @@ module.exports = {
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@ -294,3 +294,4 @@ module.exports = {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -681,3 +681,4 @@
|
||||
> 2. npm 检查缓存中是否有相同的模块,如果有,直接从缓存中读取安装
|
||||
> 3. 如果本地和缓存中均不存在,npm 会从 registry 指定的地址下载安装包,然后将其写入到本地的 node_modules 目录中,同时缓存起来。
|
||||
|
||||
|
||||
|
||||
@ -88,3 +88,4 @@
|
||||
40. 什么是 babel,有什么作用?
|
||||
|
||||
41. 解释一下 npm 模块安装机制是什么?
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user