Commit 5ef04d9f authored by shangbj's avatar shangbj

1-3安装与使用

parent c0b38bac
!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=1)}([function(e,t){e.exports=function(e){window.document.getElementById("app").innerText="Hello,"+e}},function(e,t,n){n(0)("world")}]);
\ No newline at end of file
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="app"></div>
<script src="./dist/bundle.js"></script>
</body>
</html>
\ No newline at end of file
const show = require('./show');
show('world')
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "webpack-training",
"name": "1-3",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git@gitlab.41bj.com:shangbj/webpack-training.git"
},
"author": "",
"license": "ISC"
"license": "ISC",
"devDependencies": {
"webpack": "^4.11.1",
"webpack-cli": "^3.0.2"
}
}
function show(content){
window.document.getElementById('app').innerText ='Hello,'+content;
}
module.exports = show;
\ No newline at end of file
const path = require('path');
module.exports ={
entry:'./main.js',
output:{
//合并文件
filename:'bundle.js',
//输出到dist目录
path:path.resolve(__dirname,'./dist'),
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment