-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (31 loc) · 940 Bytes
/
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
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')
module.exports = {
devtool: 'source-map',
matchers: {
html: '*(**/)*.sgr',
css: '*(**/)*.sss'
},
ignore: ['**/layout.sgr', '**/_*', '**/.*', '_cache/**', 'readme.md'],
reshape: (ctx) => {
return htmlStandards({
webpack: ctx,
locals: { pageId: pageId(ctx), foo: 'bar' }
})
},
postcss: (ctx) => {
return cssStandards({ webpack: ctx })
},
babel: { presets: [jsStandards] },
plugins: [
new HardSourcePlugin({
environmentPaths: { root: __dirname },
recordsPath: path.join(__dirname, '_cache/records.json'),
cacheDirectory: path.join(__dirname, '_cache/hard_source_cache')
})
]
}