Make chunks named
This commit is contained in:
parent
6fab7b9e3f
commit
a758e18dce
2
.babelrc
2
.babelrc
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"presets": ["@babel/preset-env"],
|
"presets": ["@babel/preset-env"],
|
||||||
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-jsx"],
|
"plugins": ["@babel/plugin-transform-runtime", "lodash", "@vue/babel-plugin-jsx"],
|
||||||
"comments": false
|
"comments": true
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,8 @@ module.exports = {
|
|||||||
output: {
|
output: {
|
||||||
path: config.build.assetsRoot,
|
path: config.build.assetsRoot,
|
||||||
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath,
|
||||||
filename: '[name].js'
|
filename: '[name].js',
|
||||||
|
chunkFilename: '[name].js'
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
|
@ -14,6 +14,7 @@ const hasLanguageFile = (code) => languages.includes(code)
|
|||||||
const loadLanguageFile = (code) => {
|
const loadLanguageFile = (code) => {
|
||||||
return import(
|
return import(
|
||||||
/* webpackInclude: /\.json$/ */
|
/* webpackInclude: /\.json$/ */
|
||||||
|
/* webpackChunkName: "i18n/[request]" */
|
||||||
`./${langCodeToJsonName(code)}.json`
|
`./${langCodeToJsonName(code)}.json`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@ const defaultState = {
|
|||||||
|
|
||||||
const loadAnnotations = (lang) => {
|
const loadAnnotations = (lang) => {
|
||||||
return import(
|
return import(
|
||||||
|
/* webpackChunkName: "emoji-annotations/[request]" */
|
||||||
`@kazvmoe-infra/unicode-emoji-json/annotations/${langCodeToCldrName(lang)}.json`
|
`@kazvmoe-infra/unicode-emoji-json/annotations/${langCodeToCldrName(lang)}.json`
|
||||||
)
|
)
|
||||||
.then(k => k.default)
|
.then(k => k.default)
|
||||||
@ -234,7 +235,7 @@ const instance = {
|
|||||||
},
|
},
|
||||||
async getStaticEmoji ({ commit }) {
|
async getStaticEmoji ({ commit }) {
|
||||||
try {
|
try {
|
||||||
const values = (await import('../../static/emoji.json')).default
|
const values = (await import(/* webpackChunkName: 'emoji' */ '../../static/emoji.json')).default
|
||||||
|
|
||||||
const emoji = Object.keys(values).reduce((res, groupId) => {
|
const emoji = Object.keys(values).reduce((res, groupId) => {
|
||||||
res[groupId] = values[groupId].map(e => ({
|
res[groupId] = values[groupId].map(e => ({
|
||||||
|
Loading…
Reference in New Issue
Block a user