github.com/criteo-forks/consul@v1.4.5-criteonogrpc/ui-v2/ember-cli-build.js (about)

     1  'use strict';
     2  
     3  const EmberApp = require('ember-cli/lib/broccoli/ember-app');
     4  module.exports = function(defaults) {
     5    const env = EmberApp.env();
     6    const prodlike = ['production', 'staging'];
     7    const isProd = env === 'production';
     8    // leave this in for now for when I start a proper staging env
     9    // const isProdLike = prodlike.indexOf(env) > -1;
    10    const sourcemaps = !isProd;
    11    let app = new EmberApp(
    12      Object.assign(
    13        {},
    14        defaults,
    15        {
    16          productionEnvironments: prodlike
    17        }
    18      ), {
    19      'ember-cli-babel': {
    20        includePolyfill: true
    21      },
    22      'ember-cli-string-helpers': {
    23        only: ['capitalize', 'lowercase', 'truncate']
    24      },
    25      'ember-cli-math-helpers': {
    26        only: ['div']
    27      },
    28      'babel': {
    29        plugins: [
    30          'transform-object-rest-spread'
    31        ]
    32      },
    33      'codemirror': {
    34        keyMaps: ['sublime'],
    35        addonFiles: [
    36          'lint/lint.css',
    37          'lint/lint.js',
    38          'lint/json-lint.js',
    39          'lint/yaml-lint.js',
    40          'mode/loadmode.js'
    41        ]
    42      },
    43      'ember-cli-uglify': {
    44        uglify: {
    45          compress: {
    46            keep_fargs: false,
    47          },
    48        },
    49      },
    50      'sassOptions': {
    51        implementation: require('node-sass'),
    52        sourceMapEmbed: sourcemaps,
    53      },
    54      'autoprefixer': {
    55        sourcemap: sourcemaps,
    56        grid: true,
    57        browsers: [
    58          "defaults",
    59          "ie 11"
    60        ]
    61      },
    62    });
    63    // Use `app.import` to add additional libraries to the generated
    64    // output files.
    65    //
    66    // If you need to use different assets in different
    67    // environments, specify an object as the first parameter. That
    68    // object's keys should be the environment name and the values
    69    // should be the asset to use in that environment.
    70    //
    71    // If the library that you are including contains AMD or ES6
    72    // modules that you would like to import into your application
    73    // please specify an object with the list of modules as keys
    74    // along with the exports of each module as its value.
    75  
    76    // TextEncoder/Decoder polyfill. See assets/index.html
    77    app.import('node_modules/text-encoding/lib/encoding-indexes.js', {outputFile: 'assets/encoding-indexes.js'});
    78    app.import('node_modules/text-encoding/lib/encoding.js', {outputFile: 'assets/encoding.js'});
    79  
    80    // JSON linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
    81    app.import('node_modules/jsonlint/lib/jsonlint.js', {outputFile: 'assets/codemirror/mode/javascript/javascript.js'});
    82    app.import('node_modules/codemirror/mode/javascript/javascript.js', {outputFile: 'assets/codemirror/mode/javascript/javascript.js'});
    83  
    84    // HCL/Ruby linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
    85    app.import('node_modules/codemirror/mode/ruby/ruby.js', {outputFile: 'assets/codemirror/mode/ruby/ruby.js'});
    86  
    87    // YAML linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
    88    app.import('node_modules/js-yaml/dist/js-yaml.js', {outputFile: 'assets/codemirror/mode/yaml/yaml.js'});
    89    app.import('node_modules/codemirror/mode/yaml/yaml.js', {outputFile: 'assets/codemirror/mode/yaml/yaml.js'});
    90    let tree = app.toTree();
    91    return tree;
    92  };