webpack.config.js v2 react + es6 +electron 配置

本文详细介绍了如何配置webpack.config.js文件,以支持React、ES6语法和Electron框架的集成开发环境。同时,提到了.eslintrc配置的相关规则,确保代码质量和规范。
摘要由CSDN通过智能技术生成
找了一圈没有webpack config v2的范例,自己搞了一个,供大家参考:
const path = require('path');


module.exports = {
    entry: "./src/index.js", // string | object | array
    // Here the application starts executing
    // and webpack starts bundling


    output: {
        // options related to how webpack emits results


        path: path.resolve(__dirname, "dist"), // string
        // the target directory for all output files
        // must be an absolute path (use the Node.js path module)


        filename: "bundle.js", // string
        // the filename template for entry chunks


        publicPath: "/assets", // string
        // the url to the output directory resolved relative to the HTML page
    },


    module: {
        // configuration regarding modules


        rules: [
            // rules for modules (configure loaders, parser options, etc.)
            {
                test: /\.js$/,
                exclude: /node_modules/,
                enforce: 'pre',
                use: [{loader: 'eslint-loader'}],
            },
            {
                test: /(\.js$|\.jsx$)/,
                include: [
                    path.resolve(__dirname, "src")
                ],
                exclude: [
                    //path.resolve(__dirname, "app/demo-fil
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值