zoukankan      html  css  js  c++  java
  • 学习react基本语法初始化webpack.config.js

    const path = require('path')
    const htmlWebpackPlugin = require('html-webpack-plugin')

    module.exports = {
      entry: path.join(__dirname, './src/main.js'),
      output: {
        path: path.join(__dirname, './dist'),
        filename: 'bundle.js'
      },
      plugins: [ // 插件
        new htmlWebpackPlugin({
          template: path.join(__dirname, './src/index.html'),
          filename: 'index.html'
        })
      ],
      module: {
        rules: [
          { test: /.css$/, use: ['style-loader', 'css-loader?modules&localIdentName=[name]_[local]-[hash:5]'] }, // 通过 为 css-loader 添加 modules 参数,启用 CSS 的模块化
          { test: /.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
          { test: /.(png|gif|bmp|jpg)$/, use: 'url-loader?limit=5000' },
          { test: /.jsx?$/, use: 'babel-loader', exclude: /node_modules/ }
        ]
      }
    }
  • 相关阅读:
    对象结构型
    对象结构型
    对象行为型模式
    定时任务(二)
    定时任务(一)
    kill端口-更新sql-添加字段
    获取ip和端口号
    List集合中的末位元素置首位
    首页报表数据展示(一)
    具体的类中包括枚举类写法
  • 原文地址:https://www.cnblogs.com/itcast-guoke/p/12920441.html
Copyright © 2011-2022 走看看