How does vue-cli package txt files under the dist folder and at the same level as index.html?

Environment:

vue-cli is version 2.0
Wechat official account needs to be placed in the background MP_verify_VyzrblyR8JxLFfPS.txt this file

question:

now I want to package the txt file into the project file dist through the configuration of webpack. What can I do?

Project path:
clipboard.png


CopyWebpackPlugin-webpack plug-in, syntax is as follows

new CopyWebpackPlugin([{ from: '**/*', to: 'relative/path/to/dest/' }
    { from: '**/*', to: '/absolute/path/to/dest/' }
  ], options)

< H2 > you can achieve < / H2 > by adding arrays to webpack.dev.conf.js and webpack..conf.js.
// copy custom static assets
new CopyWebpackPlugin([
  {
    from: path.resolve(__dirname, '../static'),
    to: config.dev.assetsSubDirectory,
    ignore: ['.*']
  },
  // dist
  {
    from: path.join(__dirname, '../*.txt'),
    to: path.join(__dirname, '../dist/')
  }
])

can be deleted by direct verification. There is no need to keep it in the root directory


if it is 3.0, configure it in config.js.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b385f6-2c0ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b385f6-2c0ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?