Skip to content

Commit 4b55018

Browse files
fix: build for standalone
1 parent 449b415 commit 4b55018

File tree

8 files changed

+21
-3858
lines changed

8 files changed

+21
-3858
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ node_modules
33

44
# Build directories
55
src/public/dist/local/bundle/
6-
src/public/dist/standalone/bundle/
6+
src/public/dist/standalone-build/
77

88
# example for dev
99
# example-project

cli/index.cli.js

100644100755
File mode changed.

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.4.6",
44
"author": "Bohdan Liashenko",
55
"license": "BSD-3-Clause",
6+
"main": "src/public/dist/standalone-build",
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/Bogdan-Lyashenko/codecrumbs.git"
@@ -14,7 +15,9 @@
1415
"client-dev": "cd src/public && webpack --config webpack.dev.js --progress --colors --watch --env dev",
1516
"server-dev": "nodemon src/index.dev.js",
1617
"server-debug": "nodemon --inspect src/index.dev.js",
17-
"build": "cd src/public && webpack --config webpack.prod.js --progress --colors",
18+
"clean": "rm -rf src/public/dist/standalone-build",
19+
"babel-compile": "babel src/public/js -d src/public/dist/standalone-build --config-file ./src/public/babel.config.js --copy-files",
20+
"build": "yarn clean && yarn babel-compile",
1821
"start:standalone": "cd src/public/dist/standalone && http-server",
1922
"pretty": "prettier --write \"./src/public/js/**/*.js\""
2023
},
@@ -53,6 +56,7 @@
5356
"websocket": "1.0.27"
5457
},
5558
"devDependencies": {
59+
"@babel/cli": "^7.4.4",
5660
"@babel/core": "^7.1.2",
5761
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
5862
"@babel/preset-env": "^7.1.0",

src/public/babel.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = function(app) {
2+
app.cache(true);
3+
4+
const presets = ['@babel/preset-env', '@babel/preset-react'];
5+
6+
const plugins = [
7+
['import', { libraryName: 'antd', libraryDirectory: 'es', style: 'css' }],
8+
'@babel/plugin-syntax-dynamic-import'
9+
];
10+
11+
return {
12+
presets,
13+
plugins
14+
};
15+
};
-464 KB
Binary file not shown.
-1.12 KB
Binary file not shown.

src/public/dist/standalone/index.html

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)