-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
42 lines (41 loc) · 1.27 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
const path = require('path')
const HardSourcePlugin = require('hard-source-webpack-plugin')
const htmlStandards = require('reshape-standard')
const cssStandards = require('spike-css-standards')
const jsStandards = require('babel-preset-latest')
const pageId = require('spike-page-id')
const postcssEasyImport = require('postcss-easy-import')
const Records = require('spike-records')
const locals = {}
module.exports = {
devtool: 'source-map',
matchers: {
html: '*(**/)*.sgr',
css: '*(**/)*.sss'
},
ignore: ['**/layout.sgr', '**/_*', '**/.*', '_cache/**', 'readme.md'],
vendor: 'assets/vendor/**',
reshape: (ctx) => {
return htmlStandards({
webpack: ctx,
locals: Object.assign({ pageId: pageId(ctx), applications_open: 'yes' }, locals)
})
},
postcss: (ctx) => {
const css = cssStandards({ webpack: ctx })
css.plugins.push(postcssEasyImport({ extensions: ['.sss'] }))
return css
},
babel: { presets: [jsStandards] },
plugins: [
new HardSourcePlugin({
environmentPaths: { root: __dirname },
recordsPath: path.join(__dirname, '_cache/records.json'),
cacheDirectory: path.join(__dirname, '_cache/hard_source_cache')
}),
new Records({
addDataTo: locals,
data: { file: 'data/data.json' }
})
]
}