From 2a45f4df6a6c5b8f1e16a1bfaa3e6331ce7d09e6 Mon Sep 17 00:00:00 2001 From: Shahriyar Imanov Date: Thu, 9 Nov 2017 16:51:54 +0100 Subject: [PATCH] WIP --- .babelrc | 3 + package.json | 88 +++++++++++++----------- readme.md | 4 +- storage/build/scripts/webpack/toolset.js | 12 ++-- 4 files changed, 59 insertions(+), 48 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..0339d5d --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["env"] +} diff --git a/package.json b/package.json index 2a7ee11..cb57ad1 100644 --- a/package.json +++ b/package.json @@ -1,44 +1,48 @@ { - "private": true, - "devDependencies": { - "clean-webpack-plugin": "^0.1.15", - "css-loader": "^0.28.0", - "extract-text-webpack-plugin": "2.1.0", - "file-loader": "^0.11.0", - "font-face-mixin": "^1.1.0", - "node-sass": "^4.0.0", - "path": "^0.12.7", - "postcss-loader": "^1.3.0", - "precss": "^1.4.0", - "sass-loader": "^6.0.3", - "style-loader": "^0.16.1", - "webpack": "^2.2.1", - "webpack-manifest-plugin": "^1.1.0", - "webpack-merge": "^4.1.0" - }, - "dependencies": { - "block-ui": "^2.70.1", - "bootstrap-hover-dropdown": "^2.2.1", - "bootstrap-sass": "^3.3.7", - "bootstrap-select": "^1.11.2", - "bootstrap-switch": "^3.3.2", - "fine-uploader": "^5.13.0", - "font-awesome": "^4.6.3", - "jquery": "^3.1.1", - "jquery-slimscroll": "^1.3.8", - "jquery-ui": "^1.12.1", - "jquery-validation": "^1.15.1", - "js-cookie": "^2.1.3", - "pace-progress": "^1.0.2", - "react": "^15.3.2", - "select2": "^4.0.3", - "select2-bootstrap-theme": "0.1.0-beta.9", - "simple-line-icons-webfont": "^4.0.3", - "skycons": "^1.0.0" - }, - "scripts": { - "build": "webpack --colors || true", - "compile": "webpack --colors --display-cached --display-cached-assets --display-error-details --display-modules --display-chunks --debug || true", - "watch": "webpack --watch --colors || true" - } + "private": true, + "main": "webpack.config.js", + "devDependencies": { + "babel-core": "^6.24.1", + "babel-loader": "^7.0.0", + "babel-preset-env": "^1.4.0", + "clean-webpack-plugin": "^0.1.15", + "css-loader": "^0.28.0", + "extract-text-webpack-plugin": "2.1.0", + "file-loader": "^0.11.0", + "font-face-mixin": "^1.1.0", + "node-sass": "^4.0.0", + "path": "^0.12.7", + "postcss-loader": "^1.3.0", + "precss": "^1.4.0", + "sass-loader": "^6.0.3", + "style-loader": "^0.16.1", + "webpack": "^2.2.1", + "webpack-manifest-plugin": "^1.1.0", + "webpack-merge": "^4.1.0" + }, + "dependencies": { + "block-ui": "^2.70.1", + "bootstrap-hover-dropdown": "^2.2.1", + "bootstrap-sass": "^3.3.7", + "bootstrap-select": "^1.11.2", + "bootstrap-switch": "^3.3.2", + "fine-uploader": "^5.13.0", + "font-awesome": "^4.6.3", + "jquery": "^3.1.1", + "jquery-slimscroll": "^1.3.8", + "jquery-ui": "^1.12.1", + "jquery-validation": "^1.15.1", + "js-cookie": "^2.1.3", + "pace-progress": "^1.0.2", + "react": "^15.5.4", + "select2": "^4.0.3", + "select2-bootstrap-theme": "0.1.0-beta.9", + "simple-line-icons-webfont": "^4.0.3", + "skycons": "^1.0.0" + }, + "scripts": { + "build": "webpack --colors || true", + "compile": "webpack --colors --display-cached --display-cached-assets --display-error-details --display-modules --display-chunks --debug || true", + "watch": "webpack --watch --colors || true" + } } diff --git a/readme.md b/readme.md index 87ac487..3282383 100644 --- a/readme.md +++ b/readme.md @@ -28,7 +28,7 @@ Audith Basis is an enhanced version of Laravel framework, a feature list for whi * [Front-end/UI] _Back-end control panel_ - comes with built-in control panel, featuring sample pages for you to expand upon. * [Front-end/UI] _Custom web-fonts, web typography support_ - build and use your own web-fonts with included toolset, from any TTF/OTF fontsets. * [Front-end/UI] _Webpack support_ - build all web assets with Webpack. -* [DevOps/CI/CD] _Docker support_ - fully Dockerized package with pre-built PHP 5.6 and 7.0 containers. +* [DevOps/CI/CD] _Docker support_ - fully Dockerized package with pre-built PHP-7 containers. ### Installation @@ -37,7 +37,7 @@ Audith Basis is an enhanced version of Laravel framework, a feature list for whi I have included a build script in ```./storage/scripts/dev-env/build.sh``` inside of which you can see steps necessary to spin up desired Docker configuration and prepare your development environment. Steps involved are: 1. Build or pull necessary Docker containers. -2. Start your desired Docker-Compose configuration (any of: PHP 5.6 or 7.0). +2. Start your Docker-Compose configuration. 3. Update your ```/etc/hosts``` file to point to the primary container in your Docker configuration - generally ```php_XXX``` is the primary container, which is linked to ```php_XXX-fpm``` and other machines. 4. Create ```.env``` file, containing your environmental variables. 5. Switch into the primary container environment, to start building your environment (Note: before doing so, please read the important note in ```build.sh``` file!): diff --git a/storage/build/scripts/webpack/toolset.js b/storage/build/scripts/webpack/toolset.js index cfe0700..0b1ae12 100644 --- a/storage/build/scripts/webpack/toolset.js +++ b/storage/build/scripts/webpack/toolset.js @@ -47,7 +47,7 @@ exports.loadersAndPluginsForVariousTypes = function () { use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: [{ - loader: 'css-loader', + loader: 'css-loader' }, { loader: 'postcss-loader' }] @@ -57,7 +57,7 @@ exports.loadersAndPluginsForVariousTypes = function () { use: ExtractTextPlugin.extract({ fallback: 'style-loader', use: [{ - loader: 'css-loader', + loader: 'css-loader' }, { loader: 'postcss-loader' }, { @@ -66,13 +66,17 @@ exports.loadersAndPluginsForVariousTypes = function () { }) }, { test: /\.(gif|jpg|png)$/, - use: process.env.npm_lifecycle_event == 'build' ? 'file-loader?name=[path][name].[hash].[ext]' : 'file-loader?name=[path][name].[ext]' + use: process.env.npm_lifecycle_event === 'build' ? 'file-loader?name=[path][name].[hash].[ext]' : 'file-loader?name=[path][name].[ext]' + }, { + test: /\.js$/, + exclude: /node_modules/, + loader: "babel-loader" } ] }, plugins: [ new ExtractTextPlugin({ - filename: process.env.npm_lifecycle_event == 'build' ? '[name].[contenthash].css' : '[name].css', // Don't use [contenthash] in dev environment, it increases compilation time. + filename: process.env.npm_lifecycle_event === 'build' ? '[name].[contenthash].css' : '[name].css', // Don't use [contenthash] in dev environment, it increases compilation time. allChunks: false }), new LoaderOptionsPlugin({