You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
glowing-bear/webpack.config.js

75 lines
2.0 KiB

"use strict";
const path = require("path");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require("copy-webpack-plugin");
const webpack = require("webpack");
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: './main.js',
mode: 'production',
output: {
path: path.resolve(__dirname, 'build'),
},
devServer: {
contentBase: path.resolve(__dirname, 'build')
},
devtool: 'source-map',
plugins: [
new HtmlWebpackPlugin({
template: './index.html',
minify: false
}),
new CopyWebpackPlugin({
patterns: [
"**/*.css",
"**/*.svg",
"**/*.png",
"directives/*.html",
"serviceworker.js",
"electron-*.js",
"../package.json",
"manifest.json",
"manifest.webapp",
"webapp.manifest.json"
]
}),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery",
Popper: ["popper.js", "default"],
}),
],
module: {
rules: [
{
test: /\.js$/i,
exclude: /node_modules/,
use: [
{
loader: 'babel-loader'
}
]
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}
]
}
]
}
};