-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathwebpack.config.js
63 lines (55 loc) · 1.61 KB
/
webpack.config.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const fs = require('fs')
const path = require('path')
const widgetWebpack = require('materia-widget-development-kit/webpack-widget')
const copy = widgetWebpack.getDefaultCopyList()
const outputPath = path.join(process.cwd(), 'build')
const customCopy = copy.concat([
{
from: path.join(__dirname, 'node_modules', 'hammerjs', 'hammer.min.js'),
to: outputPath,
},
{
from: path.join(__dirname, 'src', '_guides', 'assets'),
to: path.join(outputPath, 'guides', 'assets'),
toType: 'dir'
},
])
const entries = {
'creator.js': [
path.join(__dirname, 'src', 'print.coffee'),
path.join(__dirname, 'src', 'creator.puzzle.coffee'),
path.join(__dirname, 'src', 'creator.coffee')
],
'player.js': [
path.join(__dirname, 'src', 'print.coffee'),
path.join(__dirname, 'src', 'player.coffee')
],
'creator.css': [
path.join(__dirname, 'src', 'creator.html'),
path.join(__dirname, 'src', 'creator.scss')
],
'player.css': [
path.join(__dirname, 'src', 'player.html'),
path.join(__dirname, 'src', 'player.scss')
],
'scoreScreen.js': [
path.join(__dirname, 'src', 'scoreScreen.coffee')
],
'scoreScreen.css': [
path.join(__dirname, 'src', 'scoreScreen.html'),
path.join(__dirname, 'src', 'scoreScreen.scss')
],
'guides/player.temp.html': [
path.join(__dirname, 'src', '_guides', 'player.md')
],
'guides/creator.temp.html': [
path.join(__dirname, 'src', '_guides', 'creator.md')
]
}
const options = {
copyList: customCopy,
entries: entries
}
let buildConfig = widgetWebpack.getLegacyWidgetBuildConfig(options)
module.exports = buildConfig
// module.exports = widgetWebpack.getLegacyWidgetBuildConfig(options)