Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: i18n custom block pre-compilation bundling #93

Merged
merged 2 commits into from
May 2, 2020

Conversation

kazupon
Copy link
Member

@kazupon kazupon commented May 2, 2020

We can bundle custom block resources with JavaScript by pre-compiling with vue-loader, similar to vue-template-compiler / @vue/compiler-sfc.
We can improve the performance of our application. 馃挩

the following the pre-compiled custom block resources:

image

We need to configure webpack.config.js with using options like the below:

module.exports = {
  // ...
  module: {
    rules: [
      {
        test: /\.vue$/,
        loader: 'vue-loader'
      },
      // ...
      {
        resourceQuery: /blockType=i18n/,
        type: 'javascript/auto',
        use: [
          {
            loader: '@intlify/vue-i18n-loader',
            options: {
              preCompile: true
            }
          }
        ]
      }
    ]
  },
  plugins: [new VueLoaderPlugin()]
}

@kazupon kazupon added the Type: Feature Includes new features label May 2, 2020
@kazupon kazupon merged commit a8b1aca into next May 2, 2020
@kazupon kazupon deleted the feat/pre-compilation branch May 2, 2020 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Includes new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant