mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-29 00:10:54 +05:30
#242: build dlls during dev server start
This commit is contained in:
parent
d4e96abbca
commit
fdfb02986e
@ -8,13 +8,13 @@
|
|||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"repository": "git@gitlab.ely.by:elyby/accounts.git",
|
"repository": "git@gitlab.ely.by:elyby/accounts.git",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "rm -rf dist/ && webpack-dev-server --progress --colors",
|
"start": "rm -rf dist/ && npm run build:dll && webpack-dev-server --progress --colors",
|
||||||
"up": "npm update",
|
"up": "npm update",
|
||||||
"test": "karma start ./karma.conf.js",
|
"test": "karma start ./karma.conf.js",
|
||||||
"lint": "eslint ./src",
|
"lint": "eslint ./src",
|
||||||
"i18n": "babel-node ./scripts/i18n-collect.js",
|
"i18n": "babel-node ./scripts/i18n-collect.js",
|
||||||
"build": "rm -rf dist/ && webpack --progress --colors -p",
|
"build": "rm -rf dist/ && webpack --progress --colors -p",
|
||||||
"build:dll": "webpack --progress --colors --config webpack.dll.config.js"
|
"build:dll": "node ./scripts/build-dll.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-polyfill": "^6.3.14",
|
"babel-polyfill": "^6.3.14",
|
||||||
|
21
scripts/build-dll.js
Normal file
21
scripts/build-dll.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/* eslint-env node */
|
||||||
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const chalk = require('chalk');
|
||||||
|
|
||||||
|
const webpackConfig = require('../webpack.dll.config.js');
|
||||||
|
|
||||||
|
const compiler = webpack(webpackConfig);
|
||||||
|
|
||||||
|
compiler.run(function(err, stats) {
|
||||||
|
if (err) {
|
||||||
|
console.error(chalk.red(err));
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.error(
|
||||||
|
chalk.green('Dll was successfully build in %s ms'),
|
||||||
|
stats.endTime - stats.startTime
|
||||||
|
);
|
||||||
|
});
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-env node */
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import {sync as globSync} from 'glob';
|
import {sync as globSync} from 'glob';
|
||||||
|
Loading…
Reference in New Issue
Block a user