Skip to content

Commit 08a09bc

Browse files
committed
update for Vue 3
1 parent 0aad975 commit 08a09bc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const loader: webpack.loader.Loader = function (
1313
this.cacheable && this.cacheable()
1414
this.callback(
1515
null,
16-
`module.exports = ${generateCode(source, parse(this.resourceQuery))}`,
16+
`export default ${generateCode(source, parse(this.resourceQuery))}`,
1717
sourceMap
1818
)
1919
} catch (err) {
@@ -42,9 +42,8 @@ function generateCode(source: string | Buffer, query: ParsedUrlQuery): string {
4242

4343
let code = ''
4444
code += `function (Component) {
45-
Component.options.__i18n = Component.options.__i18n || []
46-
Component.options.__i18n.push('${value.replace(/\u0027/g, '\\u0027')}')
47-
delete Component.options._Ctor
45+
Component.__i18n = Component.__i18n || []
46+
Component.__i18n.push('${value.replace(/\u0027/g, '\\u0027')}')
4847
}\n`
4948
return code
5049
}

0 commit comments

Comments
 (0)