Last active
August 21, 2020 13:18
-
-
Save ogonkov/0ca19648bebabf8ce2d3cfbb5a82b5e0 to your computer and use it in GitHub Desktop.
expose-loader bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./test.xml'); | |
fest.app(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "expose-loader-test", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"build": "webpack" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"expose-loader": "^1.0.0", | |
"raw-loader": "^4.0.1", | |
"webpack": "^4.44.1", | |
"webpack-cli": "^3.3.12", | |
"xml2js": "^0.4.23" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<fest:template xmlns:fest="http://fest.mail.ru" context_name="json"> | |
<div> | |
Hello, world | |
</div> | |
</fest:template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
devtool: false, | |
module: { | |
rules: [ | |
{ | |
test: /\.xml$/, | |
use: [ | |
{ | |
loader: 'expose-loader', | |
options: { | |
exposes: 'fest.app' | |
} | |
}, | |
{ | |
loader: 'raw-loader', | |
options: { | |
esModule: false | |
} | |
} | |
] | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment