1
0
Fork 0

Move to react-toolbox

master
Ambrose Chua 2017-03-27 21:42:01 +08:00
parent 779815d2db
commit 94f31e0c5c
2 changed files with 60 additions and 29 deletions

View File

@ -4,24 +4,54 @@ module.exports = function (grunt) {
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
webpack: { webpack: {
app: { app: {
entry: './app/index.jsx', entry: __dirname + '/app/index.jsx',
output: { output: {
filename: 'bundle.js', filename: 'bundle.js',
path: './dist/app/' path: __dirname + '/dist/app/'
}, },
resolve: { resolve: {
extensions: ['.js', '.jsx'], extensions: ['.js', '.jsx'],
}, },
module: { module: {
loaders: [ rules: [
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader', use: [
query: { {
sourceMap: true, loader: 'babel-loader',
presets: ['env', 'react'] options: {
} sourceMap: true,
presets: ['env', 'react']
}
}
]
},
{
test: /\.css$/,
use: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: 1
}
},
{
loader: 'postcss-loader',
options: {
plugins: {
'postcss-import': {
root: __dirname,
},
'postcss-mixins': {},
'postcss-each': {},
'postcss-cssnext': {}
}
}
}
]
} }
] ]
} }
@ -32,27 +62,21 @@ module.exports = function (grunt) {
files: [ files: [
{ {
expand: true, expand: true,
cwd: './app/', cwd: __dirname + '/app/',
src: ['index.html'], src: ['index.html'],
dest: './dist/app/' dest: __dirname + '/dist/app/'
}, },
{ {
expand: true, expand: true,
cwd: './app/', cwd: __dirname + '/app/',
src: ['assets/**'], src: ['assets/**'],
dest: './dist/app/assets/' dest: __dirname + '/dist/app/assets/'
}, },
{ {
expand: true, expand: true,
cwd: './node_modules/bootstrap/', cwd: __dirname + '/node_modules/oidc-client/',
src: ['dist/**'], src: ['dist/**'],
dest: './dist/app/assets/bootstrap/' dest: __dirname + '/dist/app/assets/oidc-client/'
},
{
expand: true,
cwd: './node_modules/oidc-client/',
src: ['dist/**'],
dest: './dist/app/assets/oidc-client/'
} }
] ]
} }
@ -72,9 +96,9 @@ module.exports = function (grunt) {
files: [ files: [
{ {
expand: true, expand: true,
cwd: './server/', cwd: __dirname + '/server/',
src: ['**/*.js'], src: ['**/*.js'],
dest: './dist/server/' dest: __dirname + '/dist/server/'
} }
] ]
} }
@ -84,9 +108,9 @@ module.exports = function (grunt) {
files: [ files: [
{ {
expand: true, expand: true,
cwd: './app/', cwd: __dirname + '/app/',
src: ['**/*.js*'], src: ['**/*.js*'],
dest: './dist/app/' dest: __dirname + '/dist/app/'
} }
] ]
}, },
@ -94,9 +118,9 @@ module.exports = function (grunt) {
files: [ files: [
{ {
expand: true, expand: true,
cwd: './server/', cwd: __dirname + '/server/',
src: ['**/*.js'], src: ['**/*.js'],
dest: './dist/server/' dest: __dirname + '/dist/server/'
} }
] ]
} }

View File

@ -31,16 +31,23 @@
"grunt-contrib-copy": "^1.0.0", "grunt-contrib-copy": "^1.0.0",
"grunt-eslint": "^19.0.0", "grunt-eslint": "^19.0.0",
"grunt-webpack": "^2.0.1", "grunt-webpack": "^2.0.1",
"webpack": "^2.2.1" "webpack": "^2.3.2"
}, },
"dependencies": { "dependencies": {
"bootstrap": "^4.0.0-alpha.6", "css-loader": "^0.27.3",
"express": "^4.14.1", "express": "^4.14.1",
"mysql": "^2.13.0", "mysql": "^2.13.0",
"oidc-client": "^1.3.0-beta.3", "oidc-client": "^1.3.0-beta.3",
"postcss-cssnext": "^2.10.0",
"postcss-each": "^0.9.3",
"postcss-import": "^9.1.0",
"postcss-loader": "^1.3.3",
"postcss-mixins": "^5.4.1",
"react": "^15.4.2", "react": "^15.4.2",
"react-dom": "^15.4.2", "react-dom": "^15.4.2",
"react-router-dom": "^4.0.0-beta.6", "react-router-dom": "^4.0.0-beta.6",
"semver": "^5.3.0" "react-toolbox": "^2.0.0-beta.7",
"semver": "^5.3.0",
"style-loader": "^0.16.0"
} }
} }