-
Notifications
You must be signed in to change notification settings - Fork 3
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
webpack #7
Comments
configuration
|
ideawebpack 模仿 predator-kit (browserify) 分层
|
plugins
|
loaders |
webpack bootstrap使用
|
hotwebpack-dev-server
自动刷新inline使用 配合 log信息
浏览路径iframe浏览路径http://localhost:8080/webpack-dev-server/ Note我自己测试没有用啊... accurate const devDefault = {
// 等同于命令行中--history-api-fallback,支持刷新时router也能生效
// historyApiFallback.index必须和output.publicPath一致
historyApiFallback: {
verbose: true,
logger: console.log.bind(console),
// 避免有点号的时候不重写
disableDotRule: true,
// index必须是全路径
index: `${PUBLIC_PATH}/index.html`,
rewrites: [
{
// api 不指向index.html
from: /^.*\/api\//,
to: function (context) {
return context.parsedUrl.path;
}
}
]
},
hot: true,
quiet: false,
noInfo: false,
inline: true,
stats: {
colors: true
},
disableHostCheck: true,
watchContentBase: true,
contentBase: path.resolve(BASE_PATH, 'src'),
publicPath: PUBLIC_PATH
}; |
poiawesome tool https://poi.js.org/#/home?id=tldr
|
import()v4, import() spec 没有 chunk 相关的配置, 需要使用 comment 来指定
|
webpack loaders
require("xxx") 感叹号
!
分隔, 类似流式处理loader order
如果是
!
开头,不使用loaders如果是
!!
开头,不使用 preLoaders,loaders,postLOaders如果是
-!
开头,不使用 preLoaders,loaders例如加载一个css文件
require("!style!css!./css/style.css")
开头的!不使用js默认的转换,就是加一个function wrapper,后面经过style,css,最后是文件名
The text was updated successfully, but these errors were encountered: