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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This plugin doesn't work with typescript #6

Open
MrFranke opened this issue Mar 22, 2020 · 1 comment
Open

This plugin doesn't work with typescript #6

MrFranke opened this issue Mar 22, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@MrFranke
Copy link

Example of Webpack config file

module.exports = {
  mode: "production",
  entry: "./src/widget.ts",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "widget.[hash].js"
  },
  devServer: {
    contentBase: path.join(__dirname, "dist"),
    port: 9000
  },
  devtool: "source-map",
  resolve: {
    extensions: ['.ts', '.js', '.json']
  },
  module: {
    rules: [
      {
        test: /\.ts$/,
        exclude: /node_modules/,
        use: [{loader: "ts-loader"}]
      },
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'postcss-loader'
        ]
      },
      {
        test: /\.pcss$/,
        use: [
          'style-loader',
          {
            loader: 'css-loader',
            options: {
              modules: true,
              importLoaders: 1,
              localsConvention: 'camelCase',
            }
          },
          'postcss-loader'
        ]
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      template: "./index.html"
    }),
    new TtagWebpackPlugin({
      translations: {
        ru: path.resolve(__dirname, './i18n/ru.po')
      }
    })
  ]
};
@AlexMost
Copy link
Member

Hi @MrFranke!
Thanks for the report! Will try to investigate.
If you have some trouble with this plugin, you can try to configure it with https://github.com/ttag-org/babel-plugin-ttag. Here is a doc - https://ttag.js.org/blog/2018/09/05/hardcore-webpack-setup.html

@AlexMost AlexMost added the bug Something isn't working label Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants