1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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',
- },
- 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']
- }),
- ]
- }
|