Skip to content

Commit ddda114

Browse files
committed
ImageTransform added in readme.md
web testing done
1 parent 801f50d commit ddda114

File tree

6 files changed

+118
-94
lines changed

6 files changed

+118
-94
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
examples/
1+
.DS_Store
2+
examples/*
23
node_modules/*
34
.idea/*
45
reports/*
56
apidocs-templates/*
67
test/smtpconfig.js
7-
test/config.js
8-
8+
test/config.js

webpack/webpack.common.js

Lines changed: 33 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,37 @@ const webpack = require('webpack');
44
const path = require('path');
55

66
const Package = require('./../package.json');
7-
8-
module.exports = function (options) {
9-
return {
10-
11-
entry: {
12-
contentstack: "./src/core/contentstack",
13-
},
14-
15-
resolve: {
16-
extensions: ['.js']
17-
},
18-
19-
module: {
20-
rules: [
21-
{
22-
test: /\.js?$/,
23-
exclude: ['../node_modules'],
24-
use: [
25-
{
26-
loader:'babel-loader',
27-
options: {
28-
presets: ['es2015'],
29-
}
30-
},
31-
{
32-
loader:'string-replace-loader',
33-
query: {
34-
search: '{{VERSION}}',
35-
replace: Package.version
36-
}
37-
}
38-
],
39-
}
40-
]
41-
42-
},
43-
44-
plugins: [
45-
new webpack.IgnorePlugin(/vertx/),
46-
]
47-
48-
};
49-
}
50-
517

8+
module.exports = function(options) {
9+
return {
10+
entry: {
11+
contentstack: "./src/core/contentstack",
12+
},
13+
resolve: {
14+
extensions: ['.js']
15+
},
16+
module: {
17+
rules: [{
18+
test: /\.js?$/,
19+
exclude: ['../node_modules'],
20+
use: [{
21+
loader: 'babel-loader',
22+
options: {
23+
presets: ['es2015'],
24+
}
25+
},
26+
{
27+
loader: 'string-replace-loader',
28+
query: {
29+
search: '{{VERSION}}',
30+
replace: Package.version
31+
}
32+
}
33+
],
34+
}]
35+
},
36+
plugins: [
37+
new webpack.IgnorePlugin(/vertx/),
38+
]
39+
};
40+
}

webpack/webpack.node.js

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
11
'use strict';
22
const path = require('path');
3-
const webpackMerge = require('webpack-merge');
3+
const webpackMerge = require('webpack-merge');
44

55
const commonConfig = require('./webpack.common.js');
66

7-
module.exports = function (options) {
8-
return webpackMerge(commonConfig(),{
9-
output: {
10-
library: "Contentstack",
11-
libraryTarget:"commonjs2",
12-
path: path.join(__dirname, "../dist/node"),
13-
filename: "contentstack.js"
14-
},
15-
target: "node",
16-
resolve: {
17-
alias:{
18-
runtime: path.resolve( __dirname, '../src/runtime/node')
19-
},
20-
modules: [
21-
'../src',
22-
'../src/runtimes/node',
23-
'node_modules',
24-
]
25-
}
26-
});
27-
}
28-
29-
7+
module.exports = function(options) {
8+
return webpackMerge(commonConfig(), {
9+
output: {
10+
library: "Contentstack",
11+
libraryTarget: "commonjs2",
12+
path: path.join(__dirname, "../dist/node"),
13+
filename: "contentstack.js"
14+
},
15+
target: "node",
16+
resolve: {
17+
alias: {
18+
runtime: path.resolve(__dirname, '../src/runtime/node')
19+
},
20+
modules: [
21+
'../src',
22+
'../src/runtimes/node',
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: 'nodejs'
35+
}
36+
}],
37+
}]
38+
}
39+
});
40+
}

webpack/webpack.react-native.js

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,40 @@
11
'use strict';
22

33
const path = require('path');
4-
const webpackMerge = require('webpack-merge');
4+
const webpackMerge = require('webpack-merge');
55

66
const commonConfig = require('./webpack.common.js');
77

8-
module.exports = function (options) {
9-
return webpackMerge(commonConfig(),{
10-
output: {
11-
library: "Contentstack",
12-
libraryTarget:"commonjs2",
13-
path: path.join(__dirname, "../dist/react-native"),
14-
filename: "contentstack.js"
15-
},
16-
resolve: {
17-
alias:{
18-
runtime: path.resolve( __dirname, '../src/runtime/react-native')
19-
},
20-
modules: [
21-
'../src',
22-
'../src/runtimes/react-native',
23-
'node_modules',
24-
]
25-
}
26-
});
27-
}
28-
29-
8+
module.exports = function(options) {
9+
return webpackMerge(commonConfig(), {
10+
output: {
11+
library: "Contentstack",
12+
libraryTarget: "commonjs2",
13+
path: path.join(__dirname, "../dist/react-native"),
14+
filename: "contentstack.js"
15+
},
16+
resolve: {
17+
alias: {
18+
runtime: path.resolve(__dirname, '../src/runtime/react-native')
19+
},
20+
modules: [
21+
'../src',
22+
'../src/runtimes/react-native',
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+
}

webpack/webpack.web.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ module.exports = function(options) {
2222
'../src/runtimes/web',
2323
'node_modules'
2424
]
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: 'web'
35+
}
36+
}],
37+
}]
2538
}
2639
});
2740
}

0 commit comments

Comments
 (0)