简体   繁体   English

Vue CLI3块特定文件

[英]Vue cli3 chunk particular file

I have a project that is built with vue-cli3 and i want to single out a particular file to chunk on its own for IIS reasons. 我有一个使用vue-cli3构建的项目,出于IIS的原因,我想单独挑出一个特定的文件进行分块。 Currently webpack chunks based on default settings. 当前,Webpack块基于默认设置。 Chunks are also automatically created from my dynamic imports in vue-router. 块也是从vue-router中的动态导入自动创建的。

How can i single out a specific file(config.js) that i want to chunk on its own? 我如何才能单独选择要分块的特定文件(config.js)?

file structure: 文件结构:

src
----components
----helpers
--------config.js
--------file2.js
--------file3.js
----views
----etc

So inside the helpers directory i want to chunk out the config.js file AND also not minify it. 因此,在helpers目录中,我想对config.js文件进行分块,并且也不要缩小它。 Its a small config file that i need to modify upon installing to a server so i need to alter it with installshield. 它是一个小的配置文件,在安装到服务器时需要修改,因此我需要使用installshield对其进行更改。

Is there something to configure in the vue.config.js file? 在vue.config.js文件中是否需要配置?

Inside of vue.config.js add: 在vue.config.js内部添加:

configureWebpack: {
  entry: {
    config: './path/config.js'
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM