-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.skpm.config.js
More file actions
31 lines (24 loc) · 887 Bytes
/
webpack.skpm.config.js
File metadata and controls
31 lines (24 loc) · 887 Bytes
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
module.exports = function(config) {
config.resolve = config.resolve || {}
// map imports for react-native to react-sketchup
config.resolve.alias = {
'react-native$': 'react-sketchapp'
}
// look for sketch specific modules before generic
config.resolve.extensions = (config.resolve.extensions || []).concat(['.sketch.js', '.js'])
// use cheap source maps
config.devtool = 'eval-cheap-module-source-map'
config.module.rules = config.module.rules.map(function(rule) {
if (rule.use.loader === 'babel-loader') {
// add convenience transforms for ES7 syntax
rule.use.options = rule.use.options || {}
rule.use.options.plugins = (rule.use.options.plugins || []).concat([
'transform-runtime',
'transform-class-properties',
])
// enable source maps
rule.use.options.sourceMap = true
}
return rule
})
}