二級域名
一級域名下vue項目直接構建打包的文件引用地址爲 、/static/
npm install--save "cross-env"
複製代碼
<script type=text/javascript src=/static/js/manifest.d911f0a0eadf615.js>
複製代碼
build: {
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: process.env.env_config === "dev"? "/test/" : "/",
}
複製代碼
"scripts": {
- "build": "node build/build.js",
"build:prod": "cross-env env_config=prod node build/build.js",
"build:dev": "cross-env env_config=dev node build/build.js"
}
複製代碼