lincenying / vue2-multiple-entry Goto Github PK
View Code? Open in Web Editor NEWvue2, vue2+vue-router, vue2+vue-router+vuex 混合多页配置实例
Home Page: https://lincenying.github.io/vue2-multiple-entry/index
vue2, vue2+vue-router, vue2+vue-router+vuex 混合多页配置实例
Home Page: https://lincenying.github.io/vue2-multiple-entry/index
src/polyfill 在哪里有用到呢?
全项目搜索了下,似乎并没有啥用呀。
1.安装cssnano到DevDependencies
2. 修改 build/webpack.prod.conf.js :
`
new OptimizeCSSAssetsPlugin({
cssProcessor: require('cssnano'),
cssProcessorOptions: {
discardComments: {removeAll: true},
// 避免 cssnano 重新计算 z-index
safe: true
},
canPrint: false
})
`
npm run build之后,z-index还是被重新计算了导致样式不正常,请问如何解决这个问题,非常感谢!
多入口,每个模块会打包一个css文件,
module2 ---------- module2.css
module3 ----------- module3.css
生成的html只会引用这一个 css 文件
如果两个模块共用了部分 css,如何将公共的提取成一个 css ,然后页面会引用两个css,一个提取的公共css,一个模块的css
Hello! Thanks for cool and helpful boilerplate.
I got a question, is it possible to make structure for pages like that –
modules/
--page1/
----index.js
----index.html
--page2/
----index.js
----index.html
So instead of writing components in index.vue I want to define it in index.js and write component in html like
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="/favicon.ico">
</head>
<body>
<div id="app"></div>
<nav>
<navigation :items="items"></navigation>
</nav>
</body>
</html>
Because I dont want put all my html code to js file, but want to use a few vue components on the page.
Is it possible? Thanks!
I got this webpack.config for multiple page app too, it works but bundle's are so big it includes everything and css duplicates a lot of times. https://gist.github.com/lavezzi1/f026edef2cd819fb87c692a6bb2f4459
Help please!
我看到了许多重复的环境判断和css-load加载,应该可以合并抽离出来的。
另外,工程应该是基于Vue-cli之前的配置方式搭建的,可否考虑过调整配置和依赖跟进至新的Vue-cli配置?
您好!
dev
模式下,如何加载静态js文件呢?
我是想在index.html
里面加载requirejs
,通过requirejs
来加载服务端动态返回的组件,不知道如何写require
在 index.html页面里面的相对路径。。
Console outputs some info like
Entrypoint undefined = module2/index.html
how to fix that?
Thanks!
template/index.html中的jquery在哪里有用到?
搜索了下代码,只是看到在webpack.base.conf.js里有用到,我注释掉,程序正常。
但是删除掉 <script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
页面就渲染不出来了。
我发现基于这个架构,做单页的代码分割好像不容易,不知道楼主有什么解决办法
config.plugins.push(
new HtmlWebpackPlugin({
chunks: ['vendor', entry],
filename: entry + '/index.html',
template: 'src/template/index.html',
inject: true
})
)
我更改了下打包生成目录的结构如下
index
--- index.html
module1
--- index.html
但是在开发环境的时候访问的时候必须是http://localhost:8082/module/index.html
但是当我打包到生产的时候,却只需要http://xxx.com/module就可以了
所以你有什么办法可以在开发环境也通过http://localhost:8082/module能访问得到么
在 config/index.js dev选项中
添加
autoOpenBrowser: true
并不生效
会整体刷新而不是热重载,请问这个要如何解决呢?
控制台也没有提示 【HMR】 功能是启用的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.