Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dengjiayao committed Jun 16, 2019
1 parent 422dd8b commit ddcadf9
Show file tree
Hide file tree
Showing 7 changed files with 4,561 additions and 3,897 deletions.
11 changes: 10 additions & 1 deletion example/normal(react)/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,14 @@
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.22.0",
"react-hot-loader": "^4.1.2"
}
},
"browserslist": [
"last 2 versions",
"> 5%",
"safari >= 8",
"ie >= 10",
"Firefox ESR",
"iOS >= 8",
"android >= 4"
]
}
11 changes: 10 additions & 1 deletion example/vue@2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,14 @@
"vue-loader": "^14.2.2",
"vue-style-loader": "^4.1.0",
"vue-template-compiler": "^2.4.2"
}
},
"browserslist": [
"last 2 versions",
"> 5%",
"safari >= 8",
"ie >= 10",
"Firefox ESR",
"iOS >= 8",
"android >= 4"
]
}
8,214 changes: 4,423 additions & 3,791 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,56 +28,55 @@
},
"dependencies": {
"archiver": "^3.0.0",
"autoprefixer": "^9.3.1",
"autoprefixer": "^9.6.0",
"babel-core": "^6.26.2",
"babel-eslint": "^10.0.1",
"babel-loader": "^7.1.5",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-2": "^6.24.1",
"colors": "^1.3.2",
"commander": "^2.19.0",
"colors": "^1.3.3",
"commander": "^2.20.0",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.1",
"cssnano": "^4.1.7",
"decompress-zip": "^0.3.1",
"eslint": "^5.9.0",
"cssnano": "^4.1.10",
"decompress-zip": "^0.3.2",
"eslint": "^5.16.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.1.1",
"eslint-loader": "^2.1.2",
"eventsource-polyfill": "^0.9.6",
"extend": "^3.0.2",
"file-loader": "^2.0.0",
"function-bind": "^1.1.1",
"glob": "^7.1.3",
"handlebars": "^4.0.12",
"handlebars-loader": "^1.7.0",
"glob": "^7.1.4",
"handlebars": "^4.1.2",
"handlebars-loader": "^1.7.1",
"html-webpack-plugin": "^3.2.0",
"import-fresh": "^2.0.0",
"inquirer": "^6.2.0",
"inquirer": "^6.3.1",
"lazy-cache": "^2.0.2",
"left-pad": "^1.3.0",
"mini-css-extract-plugin": "^0.4.4",
"mini-css-extract-plugin": "^0.4.5",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"npx-handlebars-inject-loader": "^1.0.0",
"postcss": "^7.0.5",
"postcss": "^7.0.17",
"postcss-assets": "^5.0.0",
"postcss-easy-import": "^3.0.0",
"postcss-loader": "^3.0.0",
"postcss-pxtorem": "^4.0.0",
"postcss-reporter": "^6.0.0",
"postcss-reporter": "^6.0.1",
"precss": "^3.1.2",
"progress-bar-webpack-plugin": "^1.11.0",
"rimraf": "^2.6.1",
"rimraf": "^2.6.3",
"rucksack-css": "^1.0.2",
"scp2": "^0.5.0",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.1.0",
"terser-webpack-plugin": "^1.3.0",
"update-notifier": "^2.5.0",
"url-loader": "^1.1.2",
"webpack": "^4.25.1",
"webpack-babel-env-deps": "^1.4.3",
"webpack-dev-server": "^3.1.10",
"webpack-merge": "^4.1.4"
"webpack": "^4.34.0",
"webpack-dashboard": "^3.0.7",
"webpack-dev-server": "^3.7.1",
"webpack-merge": "^4.2.1"
}
}
38 changes: 25 additions & 13 deletions scripts/task/serve-client.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* @Author: dengjiayao
* @Date: 2018-04-25 16:18:40
* @Last Modified by: jiayao.deng
* @Last Modified time: 2018-08-03 14:52:13
*/
* @Author: dengjiayao
* @Date: 2018-04-25 16:18:40
* @Last Modified by: dengjiayao
* @Last Modified time: 2019-06-16 13:54:06
*/
const webpack = require('webpack')
const DevServer = require('webpack-dev-server')
// const Dashboard = require('webpack-dashboard')
// const DashboardPlugin = require('webpack-dashboard/plugin')
const colors = require('colors')
const leftPad = require('left-pad')
const path = require('path')
Expand All @@ -15,35 +17,42 @@ const getNpxConfig = require('../util/config')

async function setup(krConf, wpConf) {
const options = {
contentBase: [global.G_PATH.DIST, path.join(global.G_PATH.DIST, 'static/'), path.join(global.G_PATH.DIST, 'asset/')],
contentBase: [
global.G_PATH.DIST,
path.join(global.G_PATH.DIST, 'static/'),
path.join(global.G_PATH.DIST, 'asset/'),
],
hot: true,
headers: {
'Access-Control-Allow-Origin': '*',
'Cache-Control': 'public, max-age=0'
'Cache-Control': 'public, max-age=0',
},
host: '127.0.0.1',
port: krConf.client.port,
publicPath: wpConf.output.publicPath,
watchOptions: {
pool: true
pool: true,
},
stats: {
children: false,
colors: true,
entrypoints: false,
modules: false
}
modules: false,
},
}

DevServer.addDevServerEntrypoints(wpConf, options)
let compiler = webpack(wpConf)

// const dashboard = new Dashboard()
// compiler.apply(new DashboardPlugin(dashboard.setData))

let server = new DevServer(compiler, options)
server.use(
cssMiddleware({
src: global.G_PATH.CONTEXT,
publicPath: wpConf.output.publicPath,
env: 'development'
env: 'development',
})
)

Expand All @@ -63,7 +72,10 @@ module.exports = async () => {
console.log(colors.bgRed(`\n[task ${leftPad('dev-server', 12)}]`), err)
reject(err)
} else {
console.log(colors.bgGreen(`\n[task ${leftPad('dev-server', 12)}]`), 'server runs in port: ' + colors.bgYellow.black(PORT))
console.log(
colors.bgGreen(`\n[task ${leftPad('dev-server', 12)}]`),
'server runs in port: ' + colors.bgYellow.black(PORT)
)
resolve()
}
})
Expand Down
34 changes: 16 additions & 18 deletions scripts/util/postcssrc-default.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
/*
* @Author: dengjiayao
* @Date: 2017-12-27 13:14:56
* @Last Modified by: jiayao.deng
* @Last Modified time: 2018-07-31 17:53:40
*/
* @Author: dengjiayao
* @Date: 2017-12-27 13:14:56
* @Last Modified by: dengjiayao
* @Last Modified time: 2019-06-16 12:13:19
*/
const path = require('path')

module.exports = () => {
return {
'postcss-easy-import': {
prefix: '_'
prefix: '_',
},
precss: {
import: {
disable: true
}
disable: true,
},
},
'postcss-pxtorem': {
rootValue: 16,
propWhiteList: [],
selectorBlackList: [/^html$/]
selectorBlackList: [/^html$/],
},
'rucksack-css': {
fallbacks: true
fallbacks: true,
},
'postcss-assets': {
loadPaths: [path.join(global.G_PATH.STATIC, 'img')],
basePath: 'client',
baseUrl: '',
cachebuster: false,
relative: true
},
autoprefixer: {
browsers: ['last 2 versions', '> 5%', 'safari >= 8', 'ie >= 8', 'Firefox ESR', 'iOS >= 8', 'android >= 4']
relative: true,
},
autoprefixer: {},
cssnano: {
safe: true,
discardComments: {
removeAll: true
removeAll: true,
},
filterPlugins: false
filterPlugins: false,
},
'postcss-reporter': {
clearMessages: true
}
clearMessages: true,
},
}
}
Loading

0 comments on commit ddcadf9

Please sign in to comment.