Skip to content

Commit 068c885

Browse files
Merge pull request #2 from builtio-contentstack/add_param_method
updated the folder structure
2 parents cfcb4dd + ac5080f commit 068c885

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"buildnode": "webpack --config webpack/webpack.node.js",
1616
"buildweb": "webpack -p --config webpack/webpack.web.js",
1717
"buildreactnative": "webpack --config webpack/webpack.react-native.js",
18-
"buildall": "npm run buildnode&npm run buildweb&npm run buildreactnative",
18+
"buildnativescript": "webpack --config webpack/webpack.native-script.js",
19+
"buildall": "npm run buildnode&npm run buildweb&npm run buildreactnative&npm run buildnativescript",
1920
"generate-docs": "node_modules/.bin/jsdoc --configure docs-config.json --verbose"
2021
},
2122
"repository": {

src/runtime/native-script/http.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default fetch;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import localStorage from 'localStorage';
2+
3+
export default localStorage;

webpack/webpack.native-script.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'use strict';
2+
3+
const path = require('path');
4+
const webpackMerge = require('webpack-merge');
5+
6+
const commonConfig = require('./webpack.common.js');
7+
8+
module.exports = function(options) {
9+
return webpackMerge(commonConfig(), {
10+
output: {
11+
library: "Contentstack",
12+
libraryTarget: "commonjs2",
13+
path: path.join(__dirname, "../dist/native-script"),
14+
filename: "contentstack.js"
15+
},
16+
resolve: {
17+
alias: {
18+
runtime: path.resolve(__dirname, '../src/runtime/native-script')
19+
},
20+
modules: [
21+
'../src',
22+
'../src/runtimes/native-script',
23+
'node_modules',
24+
]
25+
},
26+
module: {
27+
rules: [{
28+
test: /\.js?$/,
29+
exclude: ['../node_modules'],
30+
use: [{
31+
loader: 'string-replace-loader',
32+
query: {
33+
search: '{{PLATFORM}}',
34+
replace: 'react-native'
35+
}
36+
}],
37+
}]
38+
}
39+
});
40+
}

0 commit comments

Comments
 (0)