git.iko.soy/rowtype-yoga/psfp
on 133b502 help sign in
rowtype-yoga/psfp/webpack.common.js
63 lines 1.2 kB history raw
1'use strict';
3const path = require('path');
5const isWebpackDevServer = process.argv.some(a => path.basename(a) === 'webpack-dev-server');
7const isWatch = process.argv.some(a => a === '--watch');
9module.exports = {
11 output: {
12 path: path.resolve(__dirname, 'dist'),
13 filename: 'bundle.js'
14 },
16 module: {
17 rules: [
18 {
19 test: /\.purs$/,
20 use: [
21 {
22 loader: 'purs-loader',
23 options: {
24 src: [
25 'src/**/*.purs',
26 'test/**/*.purs',
27 'stories/**/*.purs',
28 ],
29 spago: true,
30 watch: isWebpackDevServer || isWatch,
31 pscIde: true
32 }
33 }
34 ]
35 },
36 {
37 test: /\.css$/i,
38 use: ['style-loader', 'css-loader'],
39 },
40 {
41 test: /\.(png|jpg|gif)$/i,
42 use: [
43 {
44 loader: 'url-loader',
45 options: {
46 limit: 8192,
47 },
48 },
49 ],
50 },
51 {
52 test: /\.svg$/,
53 loader: 'react-svg-loader'
54 },
55 ]
56 },
58 resolve: {
59 modules: [ 'node_modules' ],
60 extensions: [ '.purs', '.js']
61 }
63};