@holisticon/angularjs-common
Common angular build module for AngularJS 1.x
Last updated a year ago by hypery2k .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @holisticon/angularjs-common 
SYNC missed versions from official npm registry.

AngularJS Common Module

DEPRECATED

Build Status Build status npm version Code Climate Issue Count Dependency Status devDependency Status

A simple module for AngularJS , that encapsulates the complete Webpack build and just requires some basic configuration in the using AngularJS projects without hassle around with the build

NPM

Installation

npm install @holisticon/angularjs-common --save

Or if you want to use the development version (nightly build), which maybe not stable:

npm install @holisticon/angularjs-common@next --save

Usage

Basic Usage

  • Create an config path, e.g. etc/appConfig.js:
var path = require("path");
// resolve paths
var sourceRoot = path.resolve(__dirname, '..', 'src', 'main', 'frontend'),
  testRoot = path.resolve(__dirname, '..', 'src', 'test', 'frontend'),
  distRoot = path.resolve(__dirname, '..', 'src', 'main', 'resources', 'static');
// overwrite defaults
var appConfig = {
  srcPath: 'src/main/frontend',
  testPath: 'src/test/frontend',
  entry: {
    app: sourceRoot + '/scripts/app.js',
    salesboard: sourceRoot + '/scripts/app.salesboard.js',
    assignment: sourceRoot + '/scripts/app.assignment.js'
  },
  srcApp: path.resolve(sourceRoot, 'app'),
  testApp: path.resolve(testRoot, 'specs'),
  srcSASS: path.resolve(sourceRoot, 'scss'),
  srcI18N: path.resolve(sourceRoot, 'app', 'i18n'),
  srcIMG: path.resolve(sourceRoot, 'img'),
  dist: distRoot
};
module.exports = appConfig;

And provide a dummy files for

  • karma.conf.js:
process.env['APP_CONFIG'] = require("path").resolve(__dirname, 'etc', 'appConfig.js');
module.exports = require('@holisticon/angularjs-common').karma;
  • karma.conf.ci.js:
process.env['APP_CONFIG'] = require("path").resolve(__dirname, 'etc', 'appConfig.js');
module.exports = require('@holisticon/angularjs-common').karma_ci;
  • webpack.config.js:
process.env['APP_CONFIG'] = require("path").resolve(__dirname, 'etc', 'appConfig.js');
module.exports = require('@holisticon/angularjs-common').webpack;
  • Append following entries to your package.json:
  ...
  "scripts": {
    "start": "npm install && npm run watch",
    "watch": "cross-env NODE_ENV=development webpack-dev-server --hot --inline --colors --progress --display-error-details --port 3000 ",
    "build": "cross-env NODE_ENV=production webpack",
    "test": "cross-env NODE_ENV=test karma start etc/karma.conf.ci.js",
    "debug": "cross-env NODE_ENV=test karma start etc/karma.conf.js"
  },
  ...

If you run npm run watch you can see your dependency statistics at localhost:3000/statistics.html: WEBPACK VISUALIZER

Advanced Usage

JUnit-Report customization

...
var appConfig = {
  ...
    junit: {
    title: 'MyProject',
    dir: 'dist/test-reports'
  },
  ...
};

module.exports = appConfig;

Multiple apps

var path = require("path");

// resolve paths
var sourceRoot = path.resolve(__dirname, '..', 'src', 'main', 'frontend'),
  testRoot = path.resolve(__dirname, '..', 'src', 'test', 'frontend'),
  distRoot = path.resolve(__dirname, '..', 'src', 'main', 'resources', 'static');
// overwrite defaults
var appConfig = {
  srcPath: 'src/main/frontend',
  testPath: 'src/test/frontend',
  testSpecs: '/specs/**/*.ts',
  templatesPath: 'src/main/frontend/scripts/templates',
  entry: {
    app: sourceRoot + '/scripts/app.js',
    salesboard: sourceRoot + '/scripts/app.salesboard.js',
    assignment: sourceRoot + '/scripts/app.assignment.js'
  },
  index: 'src/main/frontend/index.html',
  srcApp: path.resolve(sourceRoot, 'app'),
  testApp: path.resolve(testRoot, 'specs'),
  srcSASS: path.resolve(sourceRoot, 'scss'),
  srcI18N: path.resolve(sourceRoot, 'app', 'i18n'),
  srcIMG: path.resolve(sourceRoot, 'img'),
  dist: distRoot,
  proxy: {
    '*': 'http://localhost:8080' // REST service
  }
};
module.exports = appConfig;var path = require("path");

// resolve paths
var sourceRoot = path.resolve(__dirname, '..', 'src', 'main', 'frontend'),
  testRoot = path.resolve(__dirname, '..', 'src', 'test', 'frontend'),
  distRoot = path.resolve(__dirname, '..', 'src', 'main', 'resources', 'static');
// overwrite defaults
var appConfig = {
  srcPath: 'src/main/frontend',
  testPath: 'src/test/frontend',
  appPath: 'src/main/frontend/scripts/app*.js',
  templatesPath: 'src/main/frontend/scripts/templates',
  entry: {
    app: sourceRoot + '/scripts/app.js',
    salesboard: sourceRoot + '/scripts/app.salesboard.js',
    assignment: sourceRoot + '/scripts/app.assignment.js'
  },
  chunks: {
    filename: "commons.[chunkhash].chunk.js",
    name: "commons"
  },
  indexFiles: [{
    filename: 'index.html',
    template: 'src/main/frontend/index.html',
    chunks: ['app', 'commons'],
    chunksSortMode: 'dependency'
  }, {
    filename: 'salesboard.html',
    template: 'src/main/frontend/salesboard.html',
    chunks: ['salesboard', 'commons'],
    chunksSortMode: 'dependency'
  }, {
    filename: 'assignment.html',
    template: 'src/main/frontend/assignment.html',
    chunks: ['assignment', 'commons'],
    chunksSortMode: 'dependency'
  }],
  srcApp: path.resolve(sourceRoot, 'app'),
  testApp: path.resolve(testRoot, 'specs'),
  srcSASS: path.resolve(sourceRoot, 'scss'),
  srcI18N: path.resolve(sourceRoot, 'app', 'i18n'),
  srcIMG: path.resolve(sourceRoot, 'img'),
  dist: distRoot,
  proxy: {
    '*': 'http://localhost:8080' // REST service
  },
  additionalWebpackOptions: {
    plugins {
      /* show only de and en locale */
      new webpack.NormalModuleReplacementPlugin(
        /moment[\/\\]locale$/,
        /de|en/
      )
    }
  }
};
module.exports = appConfig;

Current Tags

  • 0.5.3                                ...           latest (a year ago)
  • 0.4.2-53                                ...           next (3 years ago)

73 Versions

  • 0.5.3                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.1                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.3                                ...           3 years ago
  • 0.4.2-53                                ...           3 years ago
  • 0.4.2                                ...           3 years ago
  • 0.4.1                                ...           3 years ago
  • 0.3.0-26                                ...           3 years ago
  • 0.3.0-25                                ...           3 years ago
  • 0.3.0-24                                ...           3 years ago
  • 0.3.0-23                                ...           3 years ago
  • 0.3.0-22                                ...           3 years ago
  • 0.3.0-21                                ...           3 years ago
  • 0.4.0-51                                ...           3 years ago
  • 0.4.0-50                                ...           3 years ago
  • 0.3.0-20                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.0-19                                ...           3 years ago
  • 0.3.0-18                                ...           3 years ago
  • 0.3.0-17                                ...           3 years ago
  • 0.3.0-14                                ...           3 years ago
  • 0.3.0-13                                ...           3 years ago
  • 0.3.0-5                                ...           4 years ago
  • 0.4.0-dev-4                                ...           4 years ago
  • 0.4.0-dev-3                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.3.0-49                                ...           4 years ago
  • 0.3.0-dev-48                                ...           4 years ago
  • 0.3.0-dev-47                                ...           4 years ago
  • 0.3.0-dev-46                                ...           4 years ago
  • 0.3.0-dev-45                                ...           4 years ago
  • 0.2.5-44                                ...           4 years ago
  • 0.2.5                                ...           4 years ago
  • 0.2.4-43                                ...           4 years ago
  • 0.2.4-42                                ...           4 years ago
  • 0.2.4-41                                ...           4 years ago
  • 0.2.4-40                                ...           4 years ago
  • 0.2.4                                ...           4 years ago
  • 0.2.4-dev-39                                ...           4 years ago
  • 0.2.3-38                                ...           4 years ago
  • 0.2.3                                ...           4 years ago
  • 0.2.3-dev-37                                ...           4 years ago
  • 0.2.3-dev-36                                ...           4 years ago
  • 0.2.3-dev-34                                ...           4 years ago
  • 0.2.3-dev-33                                ...           4 years ago
  • 0.2.3-dev-31                                ...           4 years ago
  • 0.2.3-dev-30                                ...           4 years ago
  • 0.2.2-29                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.2.2-dev-28                                ...           4 years ago
  • 0.2.2-dev-27                                ...           4 years ago
  • 0.2.1-26                                ...           4 years ago
  • 0.2.1                                ...           4 years ago
  • 0.2.1-dev-25                                ...           4 years ago
  • 0.2.0-23                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.2.0-dev-22                                ...           4 years ago
  • 0.2.0-dev-21                                ...           4 years ago
  • 0.2.0-dev-20                                ...           4 years ago
  • 0.2.0-dev-18                                ...           4 years ago
  • 0.2.0-dev-17                                ...           4 years ago
  • 0.2.0-dev-16                                ...           4 years ago
  • 0.2.0-dev-13                                ...           4 years ago
  • 0.2.0-dev-12                                ...           4 years ago
  • 0.1.2-11                                ...           4 years ago
  • 0.1.2-dev-10                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.2-dev-9                                ...           4 years ago
  • 0.1.1-8                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.1-7                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 73
This Month 73
Last Day 0
Last Week 0
Last Month 2
Dependencies (80)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |