Jump to content

Help create webpack config for compilation each react file in html


ilhmjv

Recommended Posts

Hello! How i can compilation each react file in html? I write interfaces for my server, but i don't know how to do this. I writed one config, but it compilation each react file in JS. This is not what i need.

My current webpack config:

module.exports = {
    entry: {
      index: "./src/index.js",
      app: './src/App.js'
    },
    output: {
        path: path.resolve(__dirname, 'src/buildInterfaces'),
        filename: '[name].js'
    },
    module: {
        rules: [{
                test: /\.js$/,
                exclude: [/node_modules/],
                loader: 'babel-loader',
                query: {
                  presets: ['@babel/react'],
                  plugins: ['@babel/proposal-class-properties']
                }
            },
        ]
    },
    resolve: {
        extensions: ['.js', '.json']
    },
    optimization: {
        minimize: false
    },
  mode: "production"
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...