Skip to content

Commit

Permalink
fix(beidou-webpack): remove hash name while not using module in css l…
Browse files Browse the repository at this point in the history
…oader, add client alias
  • Loading branch information
devrsi0n committed Mar 16, 2018
1 parent d1ef5af commit 81f50fb
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 113 deletions.
3 changes: 2 additions & 1 deletion examples/performance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"start": "NODE_ENV=local node ./bin/server.js",
"start-prod": "NODE_ENV=production node ./bin/server.js",
"reinstall": "lerna bootstrap",
"lint": "./node_modules/.bin/eslint --fix --ext .jsx --ext .js app client config webpack",
"lint":
"./node_modules/.bin/eslint --fix --ext .jsx --ext .js app client config webpack",
"build": "webpack --config ./webpack/webpack.config.prod.js"
},
"author": "",
Expand Down
6 changes: 1 addition & 5 deletions examples/with-rax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,5 @@
"rax-view": "^0.5.0",
"react": "^16.2.0"
},
"files": [
"app",
"client",
"config"
]
"files": ["app", "client", "config"]
}
3 changes: 2 additions & 1 deletion packages/babel-preset-beidou-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Babel preset for Beidou Client.",
"author": "六猴",
"license": "MIT",
"repository": "https://github.com/alibaba/beidou/tree/master/packages/babel-preset-beidou-client",
"repository":
"https://github.com/alibaba/beidou/tree/master/packages/babel-preset-beidou-client",
"main": "index.js",
"scripts": {
"test": "TEST_REPORTER=spec egg-bin test",
Expand Down
3 changes: 2 additions & 1 deletion packages/babel-preset-beidou-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"author": "六猴",
"license": "MIT",
"main": "index.js",
"repository": "https://github.com/alibaba/beidou/tree/master/packages/babel-preset-beidou-server",
"repository":
"https://github.com/alibaba/beidou/tree/master/packages/babel-preset-beidou-server",
"scripts": {
"test": "TEST_REPORTER=spec egg-bin test",
"cov": "TEST_REPORTER=spec egg-bin cov",
Expand Down
1 change: 1 addition & 0 deletions packages/beidou-core/config/config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module.exports = appInfo => ({
static: {
prefix: '/build',
dir: path.join(appInfo.baseDir, 'build/'),
dynamic: false,
},
});
15 changes: 4 additions & 11 deletions packages/beidou-isomorphic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
"eggPlugin": {
"name": "isomorphic"
},
"keywords": [
"beidou",
"plugin",
"isomorphic"
],
"keywords": ["beidou", "plugin", "isomorphic"],
"license": "MIT",
"dependencies": {
"babel-preset-beidou-server": "^1.0.0-beta.2",
Expand All @@ -28,13 +24,10 @@
"mkdirp": "^0.5.1",
"supertest": "1"
},
"files": [
"config",
"lib",
"app.js"
],
"files": ["config", "lib", "app.js"],
"engines": {
"node": ">= 8.0.0"
},
"repository": "https://github.com/alibaba/beidou/tree/master/packages/beidou-isomorphic"
"repository":
"https://github.com/alibaba/beidou/tree/master/packages/beidou-isomorphic"
}
9 changes: 3 additions & 6 deletions packages/beidou-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@
"react": "^16.2.0",
"supertest": "1"
},
"files": [
"app",
"lib",
"config"
],
"files": ["app", "lib", "config"],
"engines": {
"node": ">= 8.0.0"
},
"repository": "https://github.com/alibaba/beidou/tree/master/packages/beidou-view-react"
"repository":
"https://github.com/alibaba/beidou/tree/master/packages/beidou-view-react"
}
20 changes: 3 additions & 17 deletions packages/beidou-view-rax/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@
"description": "Beidou Rax server side render plugin",
"eggPlugin": {
"name": "rax",
"dep": [
"beidouView",
"isomorphic"
]
"dep": ["beidouView", "isomorphic"]
},
"keywords": [
"beidou",
"beidouPlugin",
"beidou-plugin",
"beidouView",
"rax"
],
"keywords": ["beidou", "beidouPlugin", "beidou-plugin", "beidouView", "rax"],
"main": "index.js",
"author": "<devrsi0n devrsi0n@gmail.com>",
"license": "MIT",
Expand Down Expand Up @@ -52,10 +43,5 @@
"rax-text": "^0.5.0",
"rax-view": "^0.5.0"
},
"files": [
"app",
"app.js",
"lib",
"config"
]
"files": ["app", "app.js", "lib", "config"]
}
14 changes: 4 additions & 10 deletions packages/beidou-view-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"description": "beidou view react",
"eggPlugin": {
"name": "react",
"dependencies": [
"beidouView"
]
"dependencies": ["beidouView"]
},
"main": "index.js",
"scripts": {
Expand All @@ -32,14 +30,10 @@
"should": "8",
"supertest": "1"
},
"files": [
"app",
"lib",
"config",
"app.js"
],
"files": ["app", "lib", "config", "app.js"],
"engines": {
"node": ">= 8.0.0"
},
"repository": "https://github.com/alibaba/beidou/tree/master/packages/beidou-view-react"
"repository":
"https://github.com/alibaba/beidou/tree/master/packages/beidou-view-react"
}
10 changes: 3 additions & 7 deletions packages/beidou-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
"egg-bin": "^4.0.0",
"egg-mock": "^3.7.1"
},
"files": [
"app",
"lib",
"config",
"index.js"
],
"files": ["app", "lib", "config", "index.js"],
"engines": {
"node": ">= 8.0.0"
},
"repository": "https://github.com/alibaba/beidou/tree/master/packages/beidou-view"
"repository":
"https://github.com/alibaba/beidou/tree/master/packages/beidou-view"
}
67 changes: 37 additions & 30 deletions packages/beidou-webpack/config/config.default.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
'use strict';

exports.webpack = {
// keep this key name sync with webpack.common.js reservedKey
custom: {
// configPath: 'path/to/webpack/config/file',
},
output: {
path: './build',
filename: '[name].js?[hash]',
chunkFilename: '[name].js',
publicPath: '/build/',
},
const path = require('path');

resolve: {
extensions: ['.json', '.js', '.jsx'],
},
module.exports = appInfo => ({
webpack: {
// keep this key name sync with webpack.common.js reservedKey
custom: {
// configPath: 'path/to/webpack/config/file',
},
output: {
path: './build',
filename: '[name].js?[hash]',
chunkFilename: '[name].js',
publicPath: '/build/',
},

devServer: {
contentBase: false,
port: 6002,
noInfo: true,
quiet: false,
clientLogLevel: 'warning',
lazy: false,
watchOptions: {
aggregateTimeout: 300,
resolve: {
extensions: ['.json', '.js', '.jsx'],
alias: {
client: path.join(appInfo.baseDir, 'client'),
},
},
headers: { 'X-Custom-Header': 'yes' },
stats: {
colors: true,
chunks: false,

devServer: {
contentBase: false,
port: 6002,
noInfo: true,
quiet: false,
clientLogLevel: 'warning',
lazy: false,
watchOptions: {
aggregateTimeout: 300,
},
headers: { 'X-Custom-Header': 'yes' },
stats: {
colors: true,
chunks: false,
},
publicPath: '/build/',
hot: true,
},
publicPath: '/build/',
hot: true,
},
};
});
4 changes: 2 additions & 2 deletions packages/beidou-webpack/config/webpack/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const imageLoaderConfig = {
const fileLoaderConfig = {
test: [
/\.ico$/,
/\.woff2?$/,
/\.svgz?$/,
/\.woff2?$/,
/\.otf$/,
/\.tiff?$/,
/\.ttf$/,
Expand All @@ -37,7 +37,7 @@ function getCssLoaderConfig(dev, modules = false) {
minimize: !dev,
sourceMap: dev,
modules,
localIdentName: '[local]_[hash:base64:5]',
localIdentName: modules ? '[local]_[hash:base64:5]' : undefined,
},
};
}
Expand Down
19 changes: 4 additions & 15 deletions packages/beidou-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"eggPlugin": {
"name": "webpack"
},
"keywords": [
"beidou",
"plugin",
"webpack"
],
"keywords": ["beidou", "plugin", "webpack"],
"main": "index.js",
"bin": {
"beidou-build": "./bin/build.js",
Expand Down Expand Up @@ -62,15 +58,7 @@
"peerDependencies": {
"beidou-core": "^1.0.0-alpha.5"
},
"files": [
"bin",
"app",
"lib",
"config",
"app.js",
"agent.js",
"index.js"
],
"files": ["bin", "app", "lib", "config", "app.js", "agent.js", "index.js"],
"engines": {
"node": ">= 8.0.0"
},
Expand All @@ -79,5 +67,6 @@
"cov": "TEST_REPORTER=spec egg-bin cov",
"history": "egg-bin history CHANGELOG.md"
},
"repository": "https://github.com/alibaba/beidou/tree/master/packages/beidou-webpack"
"repository":
"https://github.com/alibaba/beidou/tree/master/packages/beidou-webpack"
}
9 changes: 2 additions & 7 deletions packages/eslint-config-beidou/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
"cov": "TEST_REPORTER=spec egg-bin cov",
"history": "egg-bin history CHANGELOG.md"
},
"keywords": [
"eslint",
"beidou"
],
"files": [
"index.js"
],
"keywords": ["eslint", "beidou"],
"files": ["index.js"],
"license": "MIT",
"devDependencies": {
"egg-bin": "^4.3.7",
Expand Down

0 comments on commit 81f50fb

Please sign in to comment.