我在带有 webpack 的 symfony 4 应用程序上使用 Vue,vue-18n 工作正常。
但我想把翻译放在每个 single file component 上
我的问题是加载 de 是加载 vue-i18n-loader
我试图加载可能的方式....
有没有人做过这个?
谢谢
我的 webpack 文件:
var Encore = require('@symfony/webpack-encore');
Encore
.enableVueLoader(function(options) {
//i tried to load here
})
// ...
.addLoader({
test: /\.styl$/,
loader: 'style-loader!css-loader!stylus-loader'
})
////i tried to load here with addLoader
;
//I tried to load here with module.exports
// export the final configuration
module.exports = Encore.getWebpackConfig();
最佳答案
我们需要在 enableVueLoader
中设置选项
.enableVueLoader(function(options) {
options.loaders.i18n = '@kazupon/vue-i18n-loader'
});
关于symfony - 如何在@symfony/webpack-encore 上加载 vue-i18n-loader,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50352904/