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