简体   繁体   English

如何使用webpack加载.swf文件?

[英]How to load .swf file with webpack?

A couple of hours searching for the swf webpack loader has yielded poor results. 搜索SWF Webpack加载程序几个小时后,结果却很糟糕。 I only understand that I do need a loader at this point. 我只知道我现在确实需要装载机。 Since swf is an Adobe Flash file, I believe I just have to declare it's mime type and include it with a file-loader, but I haven't tried it. 由于swf是Adobe Flash文件,因此我相信我只需要声明它的mime类型并将其包含在文件加载器中,但是我还没有尝试过。 This is my webpack.config.js: 这是我的webpack.config.js:

 module.exports = { entry:["./script.js", "./file.swf", output:{ path:__dirname, filename:"bundle.js" }, module:{ loaders:[ //{} ] } }; 

module.exports = { 
    module: { 
        loaders: [ 
            { test: /\.swf$/, loader: "file?name=[path][name].[ext]" } 
        ] 
    } 
}

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

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