pinafore/webpack/server.config.js
Nolan Lawson 880bc7a38a
perf: use a separate icons.svg file (#1067)
* perf: use a separate icons.svg file

This splits icons into inline and non-inline. The inline ones are high
priority; the rest go in an icons.svg file.

* create SvgIcon.html

* determine inlined svgs at build time
2019-03-02 19:02:06 -08:00

39 lines
858 B
JavaScript

const webpack = require('webpack')
const config = require('sapper/config/webpack.js')
const pkg = require('../package.json')
const { mode, dev, resolve, inlineSvgs } = require('./shared.config')
module.exports = {
entry: config.server.entry(),
output: config.server.output(),
target: 'node',
resolve,
externals: Object.keys(pkg.dependencies),
module: {
rules: [
{
test: /\.html$/,
exclude: /node_modules/,
use: {
loader: 'svelte-loader',
options: {
css: false,
store: true,
generate: 'ssr',
dev
}
}
}
]
},
mode,
performance: {
hints: false // it doesn't matter if server.js is large
},
plugins: [
new webpack.DefinePlugin({
'process.env.INLINE_SVGS': JSON.stringify(inlineSvgs)
})
]
}