use a module manually
This commit is contained in:
parent
4170a3e363
commit
2b812f3d7e
@ -1,6 +1,6 @@
|
||||
Template Webpack Starting Project
|
||||
|
||||
Will include support for
|
||||
Will (eventually) include support for
|
||||
- HTML
|
||||
- ESM
|
||||
- TypeScript
|
||||
|
4
makefile
4
makefile
@ -1,7 +1,7 @@
|
||||
build:
|
||||
mkdir -p dist
|
||||
cp static/index.html dist/
|
||||
cp src/index.js dist/
|
||||
cp -r static/* dist/
|
||||
cp -r src/* dist/
|
||||
|
||||
dev-server:
|
||||
python -m http.server --directory dist/ 8700
|
||||
|
@ -1,6 +1,9 @@
|
||||
import { doWork } from "./module.js";
|
||||
|
||||
function createComponent() {
|
||||
const elem = document.createElement("div");
|
||||
elem.innerText = "Hello, Webpack";
|
||||
doWork();
|
||||
return elem;
|
||||
}
|
||||
|
||||
|
3
src/module.js
Normal file
3
src/module.js
Normal file
@ -0,0 +1,3 @@
|
||||
export function doWork() {
|
||||
console.log("doing some major work right now");
|
||||
}
|
@ -4,6 +4,6 @@
|
||||
<title>Webpack Starter</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="./index.js"></script>
|
||||
<script src="./index.js" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user