123456789101112131415161718192021222324252627282930313233 |
- const webpack = require("webpack");
- const path = require('path');
- const ExtractTextPlugin = require('extract-text-webpack-plugin');
- module.exports = {
- entry: {
- script: path.resolve(__dirname, 'src', 'index.js'),
- },
- output: {
- path: path.resolve(__dirname, 'public', 'assets'),
- filename: '[name].js',
- chunkFilename: '[name].js',
- publicPath: '/assets/'
- },
- module: {
- rules: [
- { test: /\.scss$/, use: ExtractTextPlugin.extract({ fallback: "style-loader", use: ["css-loader", "sass-loader"], publicPath: "/assets" }), exclude: /node_modules/ },
- { test: /\.js$/, use: "babel-loader", exclude: /node_modules/ },
- { test: /\.(woff|woff2)(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' },
- { test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/octet-stream' },
- { test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, loader: 'url-loader?limit=10000&mimetype=application/octet-stream' },
- { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, loader: 'file-loader' },
- ],
- },
- plugins: [
- new ExtractTextPlugin({
- filename: "style.css",
- disable: false,
- allChunks: true
- }),
- ],
- };
|