Skip to content

Commit 5e240a7

Browse files
committed
Removed vendor prefix
1 parent 7efb1bd commit 5e240a7

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ TASKS
4040
|:-----------------------------|:-----------------------------------------------------------------------|
4141
| `npm run start` | Prepare and start local dev server |
4242
| `npm run build:vendors` | Prepare npm dependencies for linking |
43-
| `npm run build:vendor-libs` | Prepare npm dependencies for linking (Scripts) |
44-
| `npm run build:vendor-style` | Prepare npm dependencies for linking (Design) |
43+
| `npm run build:libs` | Prepare npm dependencies for linking (Scripts) |
44+
| `npm run build:style` | Prepare npm dependencies for linking (Design) |
4545
| `npm run server` | Local dev server |
4646
| `npm run server:dashboard` | Local dev server in dashboard mode |
4747
| `npm run clean` | Clean generated folders |
@@ -64,7 +64,7 @@ TASKS
6464
DEVELOPMENT TIPS
6565
---
6666
* Do not disable cache in devtools (network tab): this improves speed significantly, use Ctrl + F5 to clean cache.
67-
* Try to add new external libraries (npm modules) to vendor libs list (`entry.list`) and do `npm run build:vendor-libs`
67+
* Try to add new external libraries (npm modules) to vendor libs list (`entry.libs`) and do `npm run build:libs`
6868

6969
RESOURCES
7070
---

gulpfile.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,21 @@ gulp.task('server:prestart', done => {
4848
const readPkgUp = require('read-pkg-up');
4949
const { version, dependencies } = readPkgUp.sync().pkg;
5050
const currentLibsInfo = Object.assign({}, { version }, dependencies);
51-
const libsInfoFile = Path.resolve('node_modules', '.vendor-libs.build.json');
51+
const libsInfoFile = Path.resolve('node_modules', '.libs.build.json');
5252
if (fs.existsSync(`${buildPath}/libs.json`) && fs.existsSync(libsInfoFile)) {
5353
const prevLibsInfo = require(libsInfoFile);
5454
const d = objectDiff(prevLibsInfo, currentLibsInfo);
5555
const hasDifference = _.keys(d).length > 0;
5656
if (!hasDifference) {
5757
return done();
5858
}
59-
g.util.log(g.util.colors.yellow('Version changed or found changes in dependencies, rebuilding vendor libs'));
59+
g.util.log(g.util.colors.yellow('Version changed or found changes in dependencies, rebuilding npm libs'));
6060
_.forEach(d, (version, pkname) => g.util.log(`${pkname} ${g.util.colors.cyan(version)}`));
6161
} else {
62-
g.util.log(g.util.colors.yellow('Initial build of vendor libs'));
62+
g.util.log(g.util.colors.yellow('Initial build of npm libs'));
6363
}
6464
let p = new Promise((resolve, reject) => {
65-
const proc = spawn('npm', ['run', 'build:vendor-libs'], { stdio: 'inherit' });
65+
const proc = spawn('npm', ['run', 'build:libs'], { stdio: 'inherit' });
6666
proc.on('error', reject);
6767
proc.once('exit', () => {
6868
fs.writeFileSync(libsInfoFile, JSON.stringify(currentLibsInfo));
@@ -72,8 +72,8 @@ gulp.task('server:prestart', done => {
7272
let [style] = glob.sync(`${buildPath}/style*.css`);
7373
if (!style) {
7474
p = p.then(() => new Promise((resolve, reject) => {
75-
g.util.log(g.util.colors.yellow('Initial build of vendor style'));
76-
const proc = spawn('npm', ['run', 'build:vendor-style'], { stdio: 'inherit' });
75+
g.util.log(g.util.colors.yellow('Initial style build'));
76+
const proc = spawn('npm', ['run', 'build:style'], { stdio: 'inherit' });
7777
proc.on('error', reject);
7878
proc.once('exit', resolve);
7979
}));

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
"server:dashboard": "npm run server -- --env.dashboard",
2424
"build": "webpack --progress --colors",
2525
"build:prod": "npm run build -- --env.prod",
26+
"build:prod:size": "npm run build:prod -- --display-modules --sort-modules-by=size",
2627
"dashboard": "webpack-dashboard -- npm run server:dashboard",
2728
"up": "node node_modules/updtr/bin/updtr --test-stdout --save-exact -R simple --test \"npm run test\"",
28-
"build:vendor-libs": "npm run build -- --env.vendorLibs",
29-
"build:vendor-style": "npm run build -- --env.vendorStyle",
30-
"build:vendor-style:prod": "npm run build:vendor-style -- --env.prod",
31-
"build:vendors": "npm run build:vendor-libs && npm run build:vendor-style",
29+
"build:libs": "npm run build -- --env.libs",
30+
"build:style": "npm run build -- --env.style",
31+
"build:style:prod": "npm run build:style -- --env.prod",
32+
"build:vendors": "npm run build:libs && npm run build:style",
3233
"build:all": "npm run build:vendors && npm run build",
33-
"build:all:prod": "npm run build:vendor-style:prod && npm run build:prod",
34+
"build:all:prod": "npm run build:style:prod && npm run build:prod",
3435
"build:release": "npm run clean && npm run build:all:prod",
3536
"test:build:prod": "npm run build:release && npm run gulp check:build:prod",
3637
"test:int": "npm run gulp -- test:int",

webpack.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ const watchOptions = {
1919
};
2020

2121
interface Options {
22-
vendorLibs?: boolean;
22+
libs?: boolean;
2323
dashboard?: boolean;
2424
test?: boolean;
2525
coverage?: boolean;
2626
prod?: boolean;
2727
dev?: boolean;
2828
hmr?: boolean;
2929
aot?: boolean;
30-
vendorStyle?: boolean;
30+
style?: boolean;
3131
}
3232

3333
const defaultOptions = {
34-
vendorLibs: process.argv.indexOf('--env.vendorLibs') !== -1,
35-
vendorStyle: process.argv.indexOf('--env.vendorStyle') !== -1,
34+
libs: process.argv.indexOf('--env.libs') !== -1,
35+
style: process.argv.indexOf('--env.style') !== -1,
3636
dashboard: process.argv.indexOf('--env.dashboard') !== -1,
3737
test: false,
3838
coverage: false,
@@ -209,7 +209,7 @@ export = (options: Options = {}) => {
209209
{ loader: 'postcss-loader', options: { plugins: postPlugins, sourceMap: false } },
210210
{ loader: 'sass-loader', options: { sourceMap: false } },
211211
];
212-
if (!options.vendorStyle) {
212+
if (!options.style) {
213213
result.unshift({ loader: 'style-loader', options: { sourceMap: false } });
214214
}
215215
return result;
@@ -290,7 +290,7 @@ export = (options: Options = {}) => {
290290
})()
291291
};
292292

293-
if (options.vendorLibs) {
293+
if (options.libs) {
294294
_.assign(config, {
295295
entry: _.pick(config.entry, ['libs']), // check name near DllReferencePlugin
296296
devtool: 'source-map',
@@ -307,7 +307,7 @@ export = (options: Options = {}) => {
307307
]
308308
});
309309
config.module.rules = [];
310-
} else if (options.vendorStyle) {
310+
} else if (options.style) {
311311
const CssEntryPlugin = require('css-entry-webpack-plugin');
312312
const rules: any[] = config.module.rules;
313313
_.assign(config, {

0 commit comments

Comments
 (0)