Skip to content

Commit 70481fd

Browse files
committed
import
0 parents  commit 70481fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3252
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
*.DS_Store

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "shelf-cms-sdk",
3+
"version": "1.0.0",
4+
"dependencies": {
5+
"uuid": "^9.0.0"
6+
},
7+
"main": "./src/index.js",
8+
"type": "module",
9+
"devDependencies": {
10+
"@babel/core": "^7.19.6",
11+
"@babel/preset-env": "^7.19.4",
12+
"@rollup/plugin-babel": "^6.0.2",
13+
"@rollup/plugin-commonjs": "^23.0.2",
14+
"@rollup/plugin-node-resolve": "^15.0.1",
15+
"rollup-plugin-terser": "^7.0.2"
16+
},
17+
"scripts": {
18+
"build:dev": "rollup -c --environment NODE_ENV:development -w",
19+
"build:prod": "rollup -c --environment NODE_ENV:production -w",
20+
"watch": "rollup -c -w"
21+
},
22+
"author": "",
23+
"license": "ISC",
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/wush-wush-games/wush-store-front.git"
27+
},
28+
"bugs": {
29+
"url": "https://github.com/wush-wush-games/wush-store-front/issues"
30+
},
31+
"homepage": "https://github.com/wush-wush-games/wush-store-front#readme",
32+
"description": ""
33+
}

rollup.config.mjs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { nodeResolve } from '@rollup/plugin-node-resolve';
2+
import commonjs from '@rollup/plugin-commonjs';
3+
import { babel } from '@rollup/plugin-babel';
4+
import { terser } from 'rollup-plugin-terser';
5+
6+
const devMode = (process.env.NODE_ENV === 'development');
7+
8+
let common_plugins = [
9+
nodeResolve(),
10+
commonjs(),
11+
]
12+
13+
if(!devMode)
14+
common_plugins = [...common_plugins, terser({
15+
ecma: 2020,
16+
mangle: { toplevel: true },
17+
compress: {
18+
module: true,
19+
toplevel: true,
20+
unsafe_arrows: true,
21+
drop_console: !devMode,
22+
drop_debugger: !devMode
23+
},
24+
output: { quote_style: 1, comments: false }
25+
})
26+
]
27+
28+
export default [
29+
{
30+
input: './src/index.js',
31+
output: {
32+
file: 'dist/index.cjs.js',
33+
format: 'cjs',
34+
// sourcemap: devMode ? 'inline' : false,
35+
sourcemap: devMode ? true : false,
36+
},
37+
plugins: [
38+
...common_plugins,
39+
babel({
40+
babelHelpers: 'bundled',
41+
presets: ['@babel/preset-env'],
42+
exclude: "**/node_modules/**"
43+
})
44+
],
45+
46+
},
47+
{
48+
input: './src/index.js',
49+
output: {
50+
file: 'dist/index.esm.mjs',
51+
format: 'es',
52+
sourcemap: devMode ? true : false,
53+
},
54+
plugins: common_plugins,
55+
},
56+
57+
];

0 commit comments

Comments
 (0)