123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- const path = require('path');
- const HtmlWebpackPlugin = require('html-webpack-plugin')
- module.exports = {
- //devtool: 'cheap-module-eval-source-map',
-
- entry: {
- contact: './src/contact/index.js',
- framework: ['react','react-dom','redux','react-redux'],
- staff:'./src/staff/index.js',
- workbench:'./src/workbench/index.js',
- hr:'./src/human-resource/index.js',
- product:'./src/product/index.js',
- login:'./src/login/index.js',
- },
- // output: {
- // filename: 'js/bundle.js',
- // path: path.resolve(__dirname, '../dist')
- // },
- module: {
- rules: [
- {
- test: /\.(js|jsx)$/,
- use: 'babel-loader',
- exclude: /node_modules/,
- },
- {
- test: /\.(jpg|png|gif)$/,
- use: {
- loader: 'url-loader',
- options: {
- name: '[name].[ext]',
- outputPath: 'images/',
- limit: 8192,
- },
- }
- },
-
- // {
- // test: /\.css$/,
- // use: [
- // {
- // loader:'style-loader',
- // options:{
- // insert:'top'
- // }
- // },
- // 'css-loader'],
- // },
- // {
- // test: /\.(eot|woff)$/, loader: "file-loader"
- // }
- ]
- },
- plugins: [
- new HtmlWebpackPlugin({
- template: 'public/sub_index.html',
- filename: 'contact/index.html',
- chunks:['contact','framework']
- }),
- new HtmlWebpackPlugin({
- template: 'public/sub_index.html',
- filename: 'staff/index.html',
- chunks:['staff','framework']
- }),
- new HtmlWebpackPlugin({
- template: 'public/sub_index.html',
- filename: 'hr/index.html',
- chunks:['hr','framework']
- }),
- new HtmlWebpackPlugin({
- template: 'public/sub_index.html',
- filename: 'product/index.html',
- chunks:['product','framework']
- }),
- new HtmlWebpackPlugin({
- template: 'public/index.html',
- filename: 'login.html',
- chunks:['login','framework']
- }),
- ]
- }
|