commit
1560e0b949
18
.gitignore
vendored
Normal file
18
.gitignore
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# testing
|
||||||
|
coverage
|
||||||
|
|
||||||
|
# production
|
||||||
|
build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
.env
|
||||||
|
.idea
|
||||||
|
npm-debug.log
|
||||||
|
compilation-stats.json
|
@ -1,4 +1,9 @@
|
|||||||
## Changelog CoreUI react
|
## Changelog [react](./REACT.md) version
|
||||||
|
|
||||||
|
### 2017.08.24
|
||||||
|
- webpack.config env.prod
|
||||||
|
- Dashboard .dropdown-menu-right temp.scss hotfix (full)
|
||||||
|
- callout.scss .chart-wrapper hotfix (full)
|
||||||
|
|
||||||
### 2017.08.11
|
### 2017.08.11
|
||||||
- Bootstrap 4 beta
|
- Bootstrap 4 beta
|
@ -1,4 +1,4 @@
|
|||||||
# CoreUI React version
|
# React version
|
||||||
|
|
||||||
## Intro
|
## Intro
|
||||||
|
|
||||||
@ -27,4 +27,10 @@ public/img (images)
|
|||||||
|
|
||||||
**npm run clean** to clean build dir
|
**npm run clean** to clean build dir
|
||||||
|
|
||||||
**npm run dev** to run a dev build with watching filesystem for changes
|
**npm run dev** to run a dev build with watching filesystem for changes
|
||||||
|
|
||||||
|
|
||||||
|
## See also
|
||||||
|
|
||||||
|
[Changelog](./CHANGELOG.md)
|
||||||
|
[Readme](./README.md)
|
2
React_Full_Project/.gitignore
vendored
2
React_Full_Project/.gitignore
vendored
@ -11,6 +11,8 @@ build
|
|||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
.env
|
.env
|
||||||
.idea
|
.idea
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
compilation-stats.json
|
||||||
|
7808
React_Full_Project/package-lock.json
generated
7808
React_Full_Project/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -9,14 +9,14 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"homepage": ".",
|
"homepage": ".",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.25.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-loader": "^7.1.1",
|
"babel-loader": "^7.1.2",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.23.0",
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||||
"babel-preset-env": "^1.6.0",
|
"babel-preset-env": "^1.6.0",
|
||||||
"babel-preset-react": "^6.24.1",
|
"babel-preset-react": "^6.24.1",
|
||||||
"copy-webpack-plugin": "^4.0.1",
|
"copy-webpack-plugin": "^4.0.1",
|
||||||
"css-hot-loader": "^1.3.0",
|
"css-hot-loader": "^1.3.0",
|
||||||
"css-loader": "^0.28.4",
|
"css-loader": "^0.28.5",
|
||||||
"extract-text-webpack-plugin": "^3.0.0",
|
"extract-text-webpack-plugin": "^3.0.0",
|
||||||
"file-loader": "^0.11.2",
|
"file-loader": "^0.11.2",
|
||||||
"html-loader": "^0.5.1",
|
"html-loader": "^0.5.1",
|
||||||
@ -26,29 +26,29 @@
|
|||||||
"sass-loader": "^6.0.6",
|
"sass-loader": "^6.0.6",
|
||||||
"source-list-map": "^2.0.0",
|
"source-list-map": "^2.0.0",
|
||||||
"style-loader": "^0.18.2",
|
"style-loader": "^0.18.2",
|
||||||
"uglify-js": "^3.0.27",
|
"uglify-js": "^3.0.28",
|
||||||
"url-loader": "^0.5.9",
|
"url-loader": "^0.5.9",
|
||||||
"webpack": "^3.5.3",
|
"webpack": "^3.5.5",
|
||||||
"webpack-dev-server": "^2.7.1"
|
"webpack-dev-server": "^2.7.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^4.0.0-beta",
|
"bootstrap": "^4.0.0-beta",
|
||||||
"chart.js": "2.6.0",
|
"chart.js": "2.6.0",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
"history": "4.6.3",
|
"history": "4.7.2",
|
||||||
"react": "^15.6.1",
|
"react": "^15.6.1",
|
||||||
"react-addons-css-transition-group": "^15.6.0",
|
"react-addons-css-transition-group": "^15.6.0",
|
||||||
"react-addons-transition-group": "^15.6.0",
|
"react-addons-transition-group": "^15.6.0",
|
||||||
"react-chartjs-2": "2.5.6",
|
"react-chartjs-2": "2.6.1",
|
||||||
"react-dom": "^15.6.1",
|
"react-dom": "^15.6.1",
|
||||||
"react-router-dom": "4.1.2",
|
"react-router-dom": "4.2.0",
|
||||||
"reactstrap": "^4.8.0",
|
"reactstrap": "^4.8.0",
|
||||||
"simple-line-icons": "^2.4.1"
|
"simple-line-icons": "^2.4.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack -d --progress --watch",
|
"dev": "webpack -d --progress --watch --profile --json > compilation-stats.json --env.dev",
|
||||||
"start": "webpack-dev-server --env.dev --open --hot --progress --colors --inline",
|
"start": "webpack-dev-server --progress --colors --inline --env.dev",
|
||||||
"build": "webpack -p --progress",
|
"build": "webpack -p --progress --env.prod",
|
||||||
"clean": "rimraf ./build"
|
"clean": "rimraf ./build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 18px;
|
top: 18px;
|
||||||
left: 45%;
|
left: 50%;
|
||||||
float: right;
|
float: right;
|
||||||
width: 100px;
|
width: 60%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
border-radius: 1rem !important;
|
border-radius: 1rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// temp fix for Vue-Strap
|
// temp fix for Vue & React
|
||||||
|
|
||||||
// Open state for the dropdown
|
// Open state for the dropdown
|
||||||
.open, .show {
|
.open, .show {
|
||||||
@ -20,7 +20,10 @@
|
|||||||
> .dropdown-menu {
|
> .dropdown-menu {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
> .dropdown-menu-right {
|
||||||
|
right: 0;
|
||||||
|
left: auto; // Reset the default from `.dropdown-menu`
|
||||||
|
}
|
||||||
// Remove the outline when :focus is triggered
|
// Remove the outline when :focus is triggered
|
||||||
> a {
|
> a {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
|
@ -15,7 +15,6 @@ const getPaths = (pathname) => {
|
|||||||
paths.push(currPath);
|
paths.push(currPath);
|
||||||
return currPath;
|
return currPath;
|
||||||
});
|
});
|
||||||
console.log(paths);
|
|
||||||
return paths;
|
return paths;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -41,7 +40,6 @@ const BreadcrumbsItem = ({...rest, match}) => {
|
|||||||
|
|
||||||
const Breadcrumbs = ({...rest, location : {pathname}, match}) => {
|
const Breadcrumbs = ({...rest, location : {pathname}, match}) => {
|
||||||
const paths = getPaths(pathname);
|
const paths = getPaths(pathname);
|
||||||
// const i = 0;
|
|
||||||
const items = paths.map((path, i) => <Route key={i++} path={path} component={BreadcrumbsItem}/>);
|
const items = paths.map((path, i) => <Route key={i++} path={path} component={BreadcrumbsItem}/>);
|
||||||
return (
|
return (
|
||||||
<Breadcrumb>
|
<Breadcrumb>
|
||||||
|
@ -38,7 +38,7 @@ class Sidebar extends Component {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// simple wrapper for nav-title item
|
// simple wrapper for nav-title item
|
||||||
const wrapper = item => { return (!item.wrapper ? item.name : (React.createElement(item.wrapper.element, item.wrapper.attributes, item.name))) };
|
const wrapper = item => { return (item.wrapper && item.wrapper.element ? (React.createElement(item.wrapper.element, item.wrapper.attributes, item.name)): item.name ) };
|
||||||
|
|
||||||
// nav list section title
|
// nav list section title
|
||||||
const title = (title, key) => {
|
const title = (title, key) => {
|
||||||
|
@ -13,10 +13,10 @@ export default {
|
|||||||
title: true,
|
title: true,
|
||||||
name: 'UI elements',
|
name: 'UI elements',
|
||||||
wrapper: { // optional wrapper object
|
wrapper: { // optional wrapper object
|
||||||
element: "span", // required valid HTML5 element tag
|
element: '', // required valid HTML5 element tag
|
||||||
attributes: {} // optional valid JS object with JS API naming ex: { className: "my-class", style: { fontFamily: "Verdana" }, id: "my-id"}
|
attributes: {} // optional valid JS object with JS API naming ex: { className: "my-class", style: { fontFamily: "Verdana" }, id: "my-id"}
|
||||||
},
|
},
|
||||||
class: "" // optional class names space delimited list for title item ex: "text-center"
|
class: '' // optional class names space delimited list for title item ex: "text-center"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Components',
|
name: 'Components',
|
||||||
|
@ -9,6 +9,8 @@ import Footer from '../../components/Footer/';
|
|||||||
import Dashboard from '../../views/Dashboard/';
|
import Dashboard from '../../views/Dashboard/';
|
||||||
import Charts from '../../views/Charts/';
|
import Charts from '../../views/Charts/';
|
||||||
import Widgets from '../../views/Widgets/';
|
import Widgets from '../../views/Widgets/';
|
||||||
|
|
||||||
|
// Components
|
||||||
import Buttons from '../../views/Components/Buttons/';
|
import Buttons from '../../views/Components/Buttons/';
|
||||||
import Cards from '../../views/Components/Cards/';
|
import Cards from '../../views/Components/Cards/';
|
||||||
import Forms from '../../views/Components/Forms/';
|
import Forms from '../../views/Components/Forms/';
|
||||||
@ -17,6 +19,8 @@ import SocialButtons from '../../views/Components/SocialButtons/';
|
|||||||
import Switches from '../../views/Components/Switches/';
|
import Switches from '../../views/Components/Switches/';
|
||||||
import Tables from '../../views/Components/Tables/';
|
import Tables from '../../views/Components/Tables/';
|
||||||
import Tabs from '../../views/Components/Tabs/';
|
import Tabs from '../../views/Components/Tabs/';
|
||||||
|
|
||||||
|
// Icons
|
||||||
import FontAwesome from '../../views/Icons/FontAwesome/';
|
import FontAwesome from '../../views/Icons/FontAwesome/';
|
||||||
import SimpleLineIcons from '../../views/Icons/SimpleLineIcons/';
|
import SimpleLineIcons from '../../views/Icons/SimpleLineIcons/';
|
||||||
|
|
||||||
|
@ -32,4 +32,4 @@ ReactDOM.render((
|
|||||||
<Route path="/" name="Home" component={Full}/>
|
<Route path="/" name="Home" component={Full}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
), document.getElementById('root'));
|
), document.getElementById('root'));
|
||||||
|
@ -13,98 +13,100 @@ const SRC_DIR = path.resolve(__dirname, 'src');
|
|||||||
console.log('BUILD_DIR', BUILD_DIR);
|
console.log('BUILD_DIR', BUILD_DIR);
|
||||||
console.log('SRC_DIR', SRC_DIR);
|
console.log('SRC_DIR', SRC_DIR);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = (env = {}) => {
|
||||||
entry: {
|
return {
|
||||||
index: [SRC_DIR + '/index.js']
|
entry: {
|
||||||
},
|
index: [SRC_DIR + '/index.js']
|
||||||
output: {
|
},
|
||||||
path: BUILD_DIR,
|
output: {
|
||||||
filename: '[name].bundle.js'
|
path: BUILD_DIR,
|
||||||
},
|
filename: '[name].bundle.js'
|
||||||
watch: true,
|
},
|
||||||
devServer: {
|
// watch: true,
|
||||||
contentBase: BUILD_DIR,
|
devtool: env.prod ? 'source-map' : 'cheap-module-eval-source-map',
|
||||||
// port: 9001,
|
devServer: {
|
||||||
compress: true,
|
contentBase: BUILD_DIR,
|
||||||
hot: true,
|
// port: 9001,
|
||||||
open: true
|
compress: true,
|
||||||
},
|
hot: true,
|
||||||
module: {
|
open: true
|
||||||
rules: [
|
},
|
||||||
{
|
module: {
|
||||||
test: /\.(js|jsx)$/,
|
rules: [
|
||||||
exclude: /node_modules/,
|
{
|
||||||
use: {
|
test: /\.(js|jsx)$/,
|
||||||
loader: 'babel-loader',
|
exclude: /node_modules/,
|
||||||
options: {
|
use: {
|
||||||
cacheDirectory: true,
|
loader: 'babel-loader',
|
||||||
presets: ['react', 'env']
|
options: {
|
||||||
|
cacheDirectory: true,
|
||||||
|
presets: ['react', 'env']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
test: /\.html$/,
|
||||||
test: /\.html$/,
|
loader: 'html-loader'
|
||||||
loader: 'html-loader'
|
},
|
||||||
},
|
{
|
||||||
{
|
test: /\.(scss)$/,
|
||||||
test: /\.(scss)$/,
|
use: ['css-hot-loader'].concat(extractSCSS.extract({
|
||||||
use: ['css-hot-loader'].concat(extractSCSS.extract({
|
fallback: 'style-loader',
|
||||||
fallback: 'style-loader',
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'css-loader',
|
||||||
|
options: {alias: {'../img': '../public/img'}}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
loader: 'sass-loader'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: extractCSS.extract({
|
||||||
|
fallback: 'style-loader',
|
||||||
|
use: 'css-loader'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(png|jpg|jpeg|gif|ico)$/,
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: 'css-loader',
|
// loader: 'url-loader'
|
||||||
options: { alias: { '../img': '../public/img' } }
|
loader: 'file-loader',
|
||||||
},
|
options: {
|
||||||
{
|
name: './img/[name].[hash].[ext]'
|
||||||
loader: 'sass-loader'
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}))
|
},
|
||||||
},
|
{
|
||||||
{
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
||||||
test: /\.css$/,
|
loader: 'file-loader',
|
||||||
use: extractCSS.extract({
|
options: {
|
||||||
fallback: 'style-loader',
|
name: './fonts/[name].[hash].[ext]'
|
||||||
use: 'css-loader'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.(png|jpg|jpeg|gif|ico)$/,
|
|
||||||
use: [
|
|
||||||
{
|
|
||||||
// loader: 'url-loader'
|
|
||||||
loader: 'file-loader',
|
|
||||||
options: {
|
|
||||||
name: './img/[name].[hash].[ext]'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
},
|
},
|
||||||
{
|
plugins: [
|
||||||
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
loader: 'file-loader',
|
new webpack.optimize.UglifyJsPlugin({sourceMap: true}),
|
||||||
options: {
|
new webpack.NamedModulesPlugin(),
|
||||||
name: './fonts/[name].[hash].[ext]'
|
extractCSS,
|
||||||
|
extractSCSS,
|
||||||
|
new HtmlWebpackPlugin(
|
||||||
|
{
|
||||||
|
inject: true,
|
||||||
|
template: './public/index.html'
|
||||||
}
|
}
|
||||||
}]
|
),
|
||||||
},
|
new CopyWebpackPlugin([
|
||||||
plugins: [
|
{from: './public/img', to: 'img'}
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
],
|
||||||
new webpack.optimize.UglifyJsPlugin(),
|
{copyUnmodified: false}
|
||||||
new webpack.NamedModulesPlugin(),
|
)
|
||||||
extractCSS,
|
]
|
||||||
extractSCSS,
|
}
|
||||||
new HtmlWebpackPlugin(
|
};
|
||||||
{
|
|
||||||
inject: true,
|
|
||||||
template: './public/index.html'
|
|
||||||
}
|
|
||||||
),
|
|
||||||
new CopyWebpackPlugin([
|
|
||||||
{from: './public/img', to: 'img'}
|
|
||||||
],
|
|
||||||
{copyUnmodified: false}
|
|
||||||
)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
;
|
|
2
React_Starter/.gitignore
vendored
2
React_Starter/.gitignore
vendored
@ -11,6 +11,8 @@ build
|
|||||||
|
|
||||||
# misc
|
# misc
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
.env
|
.env
|
||||||
.idea
|
.idea
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
compilation-stats.json
|
@ -1,13 +0,0 @@
|
|||||||
## Changelog CoreUI react
|
|
||||||
|
|
||||||
### 2017.08.01
|
|
||||||
- Sidebar component:
|
|
||||||
- title item with optional wrapper and class (_nav.js)
|
|
||||||
- nav link item with optional badge
|
|
||||||
- code refactoring
|
|
||||||
|
|
||||||
### 2017.07.31
|
|
||||||
- moved to [reactstrap](https://reactstrap.github.io/)
|
|
||||||
- moved to [webpack](https://webpack.js.org/) (dropping gulp)
|
|
||||||
- data driven Sidebar component (_nav.js)
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
# CoreUI React version
|
|
||||||
|
|
||||||
## Intro
|
|
||||||
|
|
||||||
It uses Sass (with .scss). The style is loaded at the component level.
|
|
||||||
|
|
||||||
Dependencies can be handled by **npm**.
|
|
||||||
|
|
||||||
## Directories
|
|
||||||
|
|
||||||
```
|
|
||||||
src (js|jsx source)
|
|
||||||
scss (scss source)
|
|
||||||
public (html template)
|
|
||||||
public/img (images)
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
**npm i** - to install dependencies
|
|
||||||
|
|
||||||
## Sctipts
|
|
||||||
|
|
||||||
**npm start** for developing (it runs webpack-dev-server)
|
|
||||||
|
|
||||||
**npm run build** to run a dev build
|
|
||||||
|
|
||||||
**npm run clean** to clean build dir
|
|
||||||
|
|
||||||
**npm run dev** to run a dev build with watching filesystem for changes
|
|
8698
React_Starter/package-lock.json
generated
8698
React_Starter/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -9,14 +9,14 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"homepage": ".",
|
"homepage": ".",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-core": "^6.25.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-loader": "^7.1.1",
|
"babel-loader": "^7.1.2",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.23.0",
|
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||||
"babel-preset-env": "^1.6.0",
|
"babel-preset-env": "^1.6.0",
|
||||||
"babel-preset-react": "^6.24.1",
|
"babel-preset-react": "^6.24.1",
|
||||||
"copy-webpack-plugin": "^4.0.1",
|
"copy-webpack-plugin": "^4.0.1",
|
||||||
"css-hot-loader": "^1.3.0",
|
"css-hot-loader": "^1.3.0",
|
||||||
"css-loader": "^0.28.4",
|
"css-loader": "^0.28.5",
|
||||||
"extract-text-webpack-plugin": "^3.0.0",
|
"extract-text-webpack-plugin": "^3.0.0",
|
||||||
"file-loader": "^0.11.2",
|
"file-loader": "^0.11.2",
|
||||||
"html-loader": "^0.5.1",
|
"html-loader": "^0.5.1",
|
||||||
@ -26,29 +26,29 @@
|
|||||||
"sass-loader": "^6.0.6",
|
"sass-loader": "^6.0.6",
|
||||||
"source-list-map": "^2.0.0",
|
"source-list-map": "^2.0.0",
|
||||||
"style-loader": "^0.18.2",
|
"style-loader": "^0.18.2",
|
||||||
"uglify-js": "^3.0.27",
|
"uglify-js": "^3.0.28",
|
||||||
"url-loader": "^0.5.9",
|
"url-loader": "^0.5.9",
|
||||||
"webpack": "^3.5.3",
|
"webpack": "^3.5.5",
|
||||||
"webpack-dev-server": "^2.7.1"
|
"webpack-dev-server": "^2.7.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^4.0.0-beta",
|
"bootstrap": "^4.0.0-beta",
|
||||||
"chart.js": "2.6.0",
|
"chart.js": "2.6.0",
|
||||||
"font-awesome": "^4.7.0",
|
"font-awesome": "^4.7.0",
|
||||||
"history": "4.6.3",
|
"history": "4.7.2",
|
||||||
"react": "^15.6.1",
|
"react": "^15.6.1",
|
||||||
"react-addons-css-transition-group": "^15.6.0",
|
"react-addons-css-transition-group": "^15.6.0",
|
||||||
"react-addons-transition-group": "^15.6.0",
|
"react-addons-transition-group": "^15.6.0",
|
||||||
"react-chartjs-2": "2.5.6",
|
"react-chartjs-2": "2.6.1",
|
||||||
"react-dom": "^15.6.1",
|
"react-dom": "^15.6.1",
|
||||||
"react-router-dom": "4.1.2",
|
"react-router-dom": "4.2.0",
|
||||||
"reactstrap": "^4.8.0",
|
"reactstrap": "^4.8.0",
|
||||||
"simple-line-icons": "^2.4.1"
|
"simple-line-icons": "^2.4.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack -d --progress --watch",
|
"dev": "webpack -d --progress --watch --profile --json > compilation-stats.json --env.dev",
|
||||||
"start": "webpack-dev-server --env.dev --open --hot --progress --colors --inline",
|
"start": "webpack-dev-server --progress --colors --inline --env.dev",
|
||||||
"build": "webpack -p --progress",
|
"build": "webpack -p --progress --env.prod",
|
||||||
"clean": "rimraf ./build"
|
"clean": "rimraf ./build"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 18px;
|
top: 18px;
|
||||||
left: 45%;
|
left: 50%;
|
||||||
float: right;
|
float: right;
|
||||||
width: 100px;
|
width: 60%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
border-radius: 1rem !important;
|
border-radius: 1rem !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
// temp fix for Vue-Strap
|
// temp fix for Vue & React
|
||||||
|
|
||||||
// Open state for the dropdown
|
// Open state for the dropdown
|
||||||
.open, .show {
|
.open, .show {
|
||||||
@ -20,7 +20,10 @@
|
|||||||
> .dropdown-menu {
|
> .dropdown-menu {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
> .dropdown-menu-right {
|
||||||
|
right: 0;
|
||||||
|
left: auto; // Reset the default from `.dropdown-menu`
|
||||||
|
}
|
||||||
// Remove the outline when :focus is triggered
|
// Remove the outline when :focus is triggered
|
||||||
> a {
|
> a {
|
||||||
outline: 0;
|
outline: 0;
|
||||||
|
@ -13,98 +13,100 @@ const SRC_DIR = path.resolve(__dirname, 'src');
|
|||||||
console.log('BUILD_DIR', BUILD_DIR);
|
console.log('BUILD_DIR', BUILD_DIR);
|
||||||
console.log('SRC_DIR', SRC_DIR);
|
console.log('SRC_DIR', SRC_DIR);
|
||||||
|
|
||||||
module.exports = {
|
module.exports = (env = {}) => {
|
||||||
entry: {
|
return {
|
||||||
index: [SRC_DIR + '/index.js']
|
entry: {
|
||||||
},
|
index: [SRC_DIR + '/index.js']
|
||||||
output: {
|
},
|
||||||
path: BUILD_DIR,
|
output: {
|
||||||
filename: '[name].bundle.js'
|
path: BUILD_DIR,
|
||||||
},
|
filename: '[name].bundle.js'
|
||||||
watch: true,
|
},
|
||||||
devServer: {
|
// watch: true,
|
||||||
contentBase: BUILD_DIR,
|
devtool: env.prod ? 'source-map' : 'cheap-module-eval-source-map',
|
||||||
// port: 9001,
|
devServer: {
|
||||||
compress: true,
|
contentBase: BUILD_DIR,
|
||||||
hot: true,
|
// port: 9001,
|
||||||
open: true
|
compress: true,
|
||||||
},
|
hot: true,
|
||||||
module: {
|
open: true
|
||||||
rules: [
|
},
|
||||||
{
|
module: {
|
||||||
test: /\.(js|jsx)$/,
|
rules: [
|
||||||
exclude: /node_modules/,
|
{
|
||||||
use: {
|
test: /\.(js|jsx)$/,
|
||||||
loader: 'babel-loader',
|
exclude: /node_modules/,
|
||||||
options: {
|
use: {
|
||||||
cacheDirectory: true,
|
loader: 'babel-loader',
|
||||||
presets: ['react', 'env']
|
options: {
|
||||||
|
cacheDirectory: true,
|
||||||
|
presets: ['react', 'env']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
test: /\.html$/,
|
||||||
test: /\.html$/,
|
loader: 'html-loader'
|
||||||
loader: 'html-loader'
|
},
|
||||||
},
|
{
|
||||||
{
|
test: /\.(scss)$/,
|
||||||
test: /\.(scss)$/,
|
use: ['css-hot-loader'].concat(extractSCSS.extract({
|
||||||
use: ['css-hot-loader'].concat(extractSCSS.extract({
|
fallback: 'style-loader',
|
||||||
fallback: 'style-loader',
|
use: [
|
||||||
|
{
|
||||||
|
loader: 'css-loader',
|
||||||
|
options: {alias: {'../img': '../public/img'}}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
loader: 'sass-loader'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}))
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: extractCSS.extract({
|
||||||
|
fallback: 'style-loader',
|
||||||
|
use: 'css-loader'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(png|jpg|jpeg|gif|ico)$/,
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: 'css-loader',
|
// loader: 'url-loader'
|
||||||
options: { alias: { '../img': '../public/img' } }
|
loader: 'file-loader',
|
||||||
},
|
options: {
|
||||||
{
|
name: './img/[name].[hash].[ext]'
|
||||||
loader: 'sass-loader'
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}))
|
},
|
||||||
},
|
{
|
||||||
{
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
||||||
test: /\.css$/,
|
loader: 'file-loader',
|
||||||
use: extractCSS.extract({
|
options: {
|
||||||
fallback: 'style-loader',
|
name: './fonts/[name].[hash].[ext]'
|
||||||
use: 'css-loader'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
{
|
|
||||||
test: /\.(png|jpg|jpeg|gif|ico)$/,
|
|
||||||
use: [
|
|
||||||
{
|
|
||||||
// loader: 'url-loader'
|
|
||||||
loader: 'file-loader',
|
|
||||||
options: {
|
|
||||||
name: './img/[name].[hash].[ext]'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
}]
|
||||||
},
|
},
|
||||||
{
|
plugins: [
|
||||||
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
loader: 'file-loader',
|
new webpack.optimize.UglifyJsPlugin({sourceMap: true}),
|
||||||
options: {
|
new webpack.NamedModulesPlugin(),
|
||||||
name: './fonts/[name].[hash].[ext]'
|
extractCSS,
|
||||||
|
extractSCSS,
|
||||||
|
new HtmlWebpackPlugin(
|
||||||
|
{
|
||||||
|
inject: true,
|
||||||
|
template: './public/index.html'
|
||||||
}
|
}
|
||||||
}]
|
),
|
||||||
},
|
new CopyWebpackPlugin([
|
||||||
plugins: [
|
{from: './public/img', to: 'img'}
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
],
|
||||||
new webpack.optimize.UglifyJsPlugin(),
|
{copyUnmodified: false}
|
||||||
new webpack.NamedModulesPlugin(),
|
)
|
||||||
extractCSS,
|
]
|
||||||
extractSCSS,
|
}
|
||||||
new HtmlWebpackPlugin(
|
};
|
||||||
{
|
|
||||||
inject: true,
|
|
||||||
template: './public/index.html'
|
|
||||||
}
|
|
||||||
),
|
|
||||||
new CopyWebpackPlugin([
|
|
||||||
{from: './public/img', to: 'img'}
|
|
||||||
],
|
|
||||||
{copyUnmodified: false}
|
|
||||||
)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
;
|
|
Loading…
Reference in New Issue
Block a user