Vue-cli what do I need to do to access this document in localhost:8080/abc.txt? Official account web page development

because the developer Wechat needs to configure a secure domain name, the domain name and request url are limited.

   :abc.weixin.com 
  abc.weixin.com/abc.txt  vuehash
  abc.weixin.com/abc.txt  
 abc.weixin.com/app.js  webpack
 vue  
  
  npm start   / 
Jun.23,2021

if you are using vue-cli3, just put it under the public folder.

ide/html-and-static-assets.html-sharppublic-%E6%96%87%E4%BB%B6%E5%A4%B9" rel=" nofollow noreferrer "> ide/html-and-static-assets.html-sharppublic-%E6%96%87%E4%BB%B6%E5%A4%B9" rel= "nofollow noreferrer" > https://cli.vuejs.org/zh/guid.


3 is really very simple to configure, just like the files mentioned above are placed in the public under the root directory

I would like to add some parsing of the source code:

in the file: @ vue/cli-service/lib/config/app.js

const publicDir = api.resolve('public')
    if (!isLegacyBundle && fs.existsSync(publicDir)) {
      webpackConfig
        .plugin('copy')
          .use(require('copy-webpack-plugin'), [[{
            from: publicDir,
            to: outputDir,
            ignore: publicCopyIgnore
          }]])
    }

eventually, the public directory will be copied to the packaged directory through copy-webpack-plugin

Menu