git.iko.soy/rowtype-yoga/psfp
on 5dfb687 help sign in
rowtype-yoga/psfp/client/webpack.common.js
72 lines 1.4 kB history raw
1"use strict";
3const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
5const path = require("path");
7const isWebpackDevServer = process.argv.some(
8 a => path.basename(a) === "webpack-dev-server"
9);
11const isWatch = process.argv.some(a => a === "--watch");
13module.exports = {
14 output: {
15 path: path.resolve(__dirname, "dist"),
16 filename: "bundle.js"
17 },
19 module: {
20 rules: [
21 {
22 test: /\.purs$/,
23 use: [
24 {
25 loader: "purs-loader",
26 options: {
27 src: [
28 "src/**/*.purs",
29 "test/**/*.purs",
30 "stories/**/*.purs",
31 "dce-output/**/*.purs"
32 ],
33 spago: true,
34 watch: isWebpackDevServer || isWatch,
35 pscIde: true
36 }
37 }
38 ]
39 },
40 {
41 test: /\.css$/i,
42 use: ["style-loader", "css-loader"]
43 },
44 {
45 test: /\.(png|jpg|gif)$/i,
46 use: [
47 {
48 loader: "url-loader",
49 options: {
50 limit: 8192
51 }
52 }
53 ]
54 },
55 {
56 test: /\.svg$/,
57 loader: "react-svg-loader"
58 },
59 {
60 test: /\.(woff|woff2|eot|ttf|otf)$/,
61 use: ["file-loader"]
62 }
63 ]
64 },
66 resolve: {
67 modules: ["node_modules"],
68 extensions: [".purs", ".js"]
69 },
71 plugins: [new MonacoWebpackPlugin()]
72};