Skip to content

zhangly409/xml-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xml-loader

为什么需要 loader

webpack只能解析js和JSON文件,需要loader对于一些解析不了的文件进行转换。

定义一个loader

见 src/loader/xml-loader

webpack配置

```js
configureWebpack: {
        resolveLoader: {
        modules: ['node_modules', path.join(__dirname, 'src/loader')],
        },
    },
chainWebpack: config => {
    config.module
        .rule('xml')
        .test(/\.xml$/)
        .use('xml-loader')
        .loader('xml-loader')
        .end()
}
```

About

自定义一个webpack loader demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published