javascript - Want to load a txt file using file-loader
漂亮男人
漂亮男人 2017-05-19 10:38:20
0
1
492

Writing webpack.config.js like this seems invalid

  module:{
      loaders:[{
          test:/\.txt$/,
          loader:'file-loader'
      }]
  },

It’s been a long time and I’m almost crying

漂亮男人
漂亮男人

reply all(1)
小葫芦

Isn’t there an example on the official website of file-loader:

In config

{ test: /\.html?$/, loader: 'file?name=html/[name].[ext]' },

In the js entry file (flash.txt is now in the same directory as the entry js)

require("file-loader?name=[hash]!./flash.txt");
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template