HTML作为Webpack的切入点 [英] HTML as Webpack entry point

查看:120
本文介绍了HTML作为Webpack的切入点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我是Web开发的新手,所以如果我的方法是完全错误的,那就这么说.

First of all, I'm completely new to web development so if my approach is totally wrong, just say so.

我想自动构建sass和ts文件,因此我读到了 Gulp/Webpack ,似乎webpack是解决之道.

I want to automate build of sass and ts files, so I read about Gulp/Webpack, and seems like webpack is the way to go.

我正在构建一个简单的单页网站,现在我只需要一个小的javascript,因此在我看来,webpack的入口点应该是html文件本身.但是,所有文档和教程都只谈论从.js开始.

I am building a simple single page website and for now I only have a small javascript that's needed, so it makes sense in my mind that the entry point for webpack should be the html file itself. However, all the docs and tutorials only talk about starting from a .js.

是否可以通过从HTML开始并解析js,css,图像和其他必需的东西?

Is there a way to start from the HTML and resolve js, css, images and other required stuff?

我应该只使用webpack进行报废,还是使用gulp来编译打字稿和sass吗?

Should I just scrap using webpack and just use gulp to compile the typescript and sass?

推荐答案

一种替代方法是使用宗地,支持将HTML文件作为 entry .

One alternative would be to use Parcel, which supports having a HTML file as the entry.

这篇关于HTML作为Webpack的切入点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆