forked from contentstack/contentstack-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.react-native.js
executable file
·40 lines (37 loc) · 1.09 KB
/
webpack.react-native.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
'use strict';
const path = require('path');
const webpackMerge = require('webpack-merge');
const commonConfig = require('./webpack.common.js');
module.exports = function(options) {
return webpackMerge(commonConfig(), {
output: {
library: "Contentstack",
libraryTarget: "commonjs2",
path: path.join(__dirname, "../dist/react-native"),
filename: "contentstack.js"
},
resolve: {
alias: {
runtime: path.resolve(__dirname, '../src/runtime/react-native')
},
modules: [
'../src',
'../src/runtimes/react-native',
'node_modules',
]
},
module: {
rules: [{
test: /\.js?$/,
exclude: '/node_modules/',
use: [{
loader: 'string-replace-loader',
query: {
search: '{{PLATFORM}}',
replace: 'react-native'
}
}],
}]
}
});
}