This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
orion/cmd/server/webpack.config.js
William Petit 713ca17c62
Some checks reported errors
Pyxis/orion/feature%2Fjsonrpc-next Something is wrong with the build of this commit
Pyxis/orion/pipeline/head Something is wrong with the build of this commit
LaCanne/orion/pipeline/head Something is wrong with the build of this commit
WIP: JSONRPC server refactoring
2019-02-12 10:17:06 +01:00

68 lines
1.4 KiB
JavaScript

const path = require('path');
const env = process.env;
// Plugins
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
mode: `${env.NODE_ENV ? env.NODE_ENV : 'production'}`,
entry: {
server: './static/src/index.js',
},
devtool: 'eval-source-map',
output: {
filename: '[name].js',
path: path.join(__dirname, 'static', 'dist')
},
module: {
rules: [{
test: /\.(scss|sass)$/,
include: [
path.resolve(__dirname, 'node_modules'),
],
use: [
MiniCssExtractPlugin.loader,
{
loader: "css-loader",
options: {}
},
{
loader: "resolve-url-loader",
options: {}
},
{
loader: "sass-loader",
options: {
sourceMap: true,
sourceMapContents: false
}
}
]
},{
test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: '/fonts/'
}
}]
},{
test: /\.(svg|png|jpg)(\?v=\d+\.\d+\.\d+)?$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: '/img/'
}
}]
}]
},
plugins: [
new MiniCssExtractPlugin({
filename: "/css/[name].css",
chunkFilename: "/css/[id].css"
})
]
}