Created
September 27, 2018 08:46
-
-
Save davidcsejtei/ff6d5dc669a38c12394eb2136eb5f1be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require('path'); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
| module.exports = { | |
| entry: ["babel-polyfill", "./src/index.js"], | |
| plugins: [ | |
| new HtmlWebpackPlugin({ | |
| title: '', | |
| template: './webpack-template/index.ejs', | |
| inject: 'body', | |
| }), | |
| new CopyWebpackPlugin([ | |
| {from: './img', to: 'img'} | |
| ]) | |
| ], | |
| output: { | |
| filename: '[name].bundle.js', | |
| publicPath: '/', | |
| path: path.resolve(__dirname, 'dist') | |
| }, | |
| resolve: { | |
| alias: { | |
| react: path.resolve(__dirname, 'node_modules', 'react') | |
| } | |
| }, | |
| module: { | |
| rules: [ | |
| { | |
| test: /\.js$/, | |
| exclude: /node_modules/, | |
| use: { | |
| loader: "babel-loader" | |
| } | |
| }, | |
| { | |
| test: /\.(scss|css)$/, | |
| use: [ | |
| {loader: "style-loader"}, | |
| {loader: "css-loader"}, | |
| {loader: "sass-loader"} | |
| ] | |
| }, | |
| { | |
| test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/, | |
| use: [{ | |
| loader: 'file-loader', | |
| options: { | |
| name: '[name].[ext]', | |
| outputPath: 'fonts/' | |
| } | |
| }] | |
| } | |
| ] | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment