Git Product home page Git Product logo

Comments (4)

niieani avatar niieani commented on June 9, 2024

Seems like Wallaby is not loading the AureliaWebpackPlugin. I don't have a license for Wallaby, so hard for me to help with that particular problem, I believe it could be solved with the right configuration file for Wallaby.

from loader-webpack.

stevies avatar stevies commented on June 9, 2024

Thanks. I'll see what I do with the Wallaby config. In any case, it may be that this gets fixed when #19 gets resolved.

For info - this is my wallabyjs config file - works perfectly until I add :

import {bootstrap} from 'aurelia-bootstrapper-webpack';

to a test.

/// Loading existing webpack config
process.env.NODE_ENV = 'test';
var webpackConfig = require('./webpack.config');

// Cleaning it
delete webpackConfig.entry;
delete webpackConfig.devServer;
delete webpackConfig.resolve.root;
delete webpackConfig.module.postLoaders;
webpackConfig.module.loaders.shift();
webpackConfig.plugins = webpackConfig.plugins.filter(p => !p.getPath);
webpackConfig.entryPatterns = ['test/unit/setup.js', 'test/**/*.spec.js'];

var wallabyWebpack = require('wallaby-webpack');
var wallabyPostprocessor = wallabyWebpack(webpackConfig);

module.exports = function (wallaby) {
  return {
    files: [
      {pattern: 'node_modules/jasmine-expect/dist/jasmine-matchers.js', load: true, instrument: false},
      {pattern: 'node_modules/sinon/pkg/sinon.js', instrument: false},
      {pattern: 'test/unit/setup.js', load: false},
      {pattern: 'src/**/*.js', load: false}
    ],

    tests: [
      '!test/e2e/**',
      {pattern: 'test/**/*.spec.js', load: false}
    ],

    postprocessor: wallabyPostprocessor,

    compilers: {
      '**/*.js': wallaby.compilers.babel({
        presets: ['es2015', 'stage-1'],
        plugins: ['transform-decorators-legacy']
      })
    },

    setup: function () {
      window.__moduleBundler.loadTests();
    },

    debug: true
  };
};

This is my webpack.conf.js file:

/**
 * To learn more about how to use Easy Webpack
 * Take a look at the README here: https://github.com/easy-webpack/core
 **/
const webpack = require('webpack');
const easyWebpack = require('@easy-webpack/core');
const generateConfig = easyWebpack.default;
const path = require('path');

let ENV = process.env.NODE_ENV && process.env.NODE_ENV.toLowerCase() || 'development';

if (process.env.FAKE_DATA) {
  ENV += '_fake_data';
}

const definePlugin = new webpack.DefinePlugin({
  __ENV__: "'" + ENV + "'"
});

// basic configuration:
const title = 'my app';
const baseUrl = '/';
const rootDir = path.resolve();
const srcDir = path.resolve('src');
const outDir = path.resolve('dist');

const coreBundles = {
  bootstrap: [
    'aurelia-bootstrapper-webpack',
    'aurelia-polyfills',
    'aurelia-pal',
    'aurelia-pal-browser',
    'regenerator-runtime',
    'bluebird'
  ],
  // these will be included in the 'aurelia' bundle (except for the above bootstrap packages)
  aurelia: [
    'aurelia-bootstrapper-webpack',
    'aurelia-binding',
    'aurelia-configuration',
    'aurelia-dependency-injection',
    'aurelia-event-aggregator',
    'aurelia-fetch-client',
    'aurelia-framework',
    'aurelia-history',
    'aurelia-history-browser',
    'aurelia-http-client',
    'aurelia-loader',
    'aurelia-loader-webpack',
    'aurelia-logging',
    'aurelia-logging-console',
    'aurelia-metadata',
    'aurelia-pal',
    'aurelia-pal-browser',
    'aurelia-path',
    'aurelia-polyfills',
    'aurelia-route-recognizer',
    'aurelia-router',
    'aurelia-task-queue',
    'aurelia-templating',
    'aurelia-templating-binding',
    'aurelia-templating-router',
    'aurelia-templating-resources',
    'aurelia-validation'
  ],
  vendor: [
    'moment'
  ]
};

const baseConfig = {
  entry: {
    'app': ['./src/main'],
    'aurelia-bootstrap': coreBundles.bootstrap,
    'aurelia': coreBundles.aurelia.filter(pkg => coreBundles.bootstrap.indexOf(pkg) === -1),
    'vendor': coreBundles.vendor
  },
  output: {
    path: outDir
  },
  plugins: [definePlugin]
};

// advanced configuration:
switch (ENV) {
  case 'production':
    config = generateConfig(
      baseConfig,

      require('@easy-webpack/config-env-production')
      ({compress: true}),

      require('@easy-webpack/config-aurelia')
      ({root: rootDir, src: srcDir, title: title, baseUrl: baseUrl}),

      require('@easy-webpack/config-babel')(),
      require('@easy-webpack/config-html')(),
      require('@easy-webpack/config-json')(),

      require('@easy-webpack/config-sass')
      ({filename: 'gds.css', allChunks: true, sourceMap: false}),

      require('@easy-webpack/config-fonts-and-images')(),
      require('@easy-webpack/config-global-bluebird')(),
      require('@easy-webpack/config-global-regenerator')(),
      require('@easy-webpack/config-generate-index-html')
      ({
        minify: false, overrideOptions: {
          'xhtml': true
        }
      }),

      require('@easy-webpack/config-copy-files')
      ({
        patterns: [
          {from: 'favicon.ico', to: 'favicon.ico'},
          {from: 'config/**/*', to: './'}
        ]
      }),

      require('@easy-webpack/config-common-chunks-simple')
      ({appChunkName: 'app', firstChunk: 'aurelia-bootstrap'}),

      require('@easy-webpack/config-uglify')
      ({debug: false})
    );
    break;

  case 'test':
    config = generateConfig(
      baseConfig,

      require('@easy-webpack/config-env-development')
      ({devtool: 'inline-source-map'}),

      require('@easy-webpack/config-aurelia')
      ({root: rootDir, src: srcDir, title: title, baseUrl: baseUrl}),

      require('@easy-webpack/config-babel')(),
      require('@easy-webpack/config-html')(),
      require('@easy-webpack/config-json')(),

      require('@easy-webpack/config-sass')
      ({filename: 'gds.css', allChunks: true, sourceMap: false}),

      require('@easy-webpack/config-fonts-and-images')(),
      require('@easy-webpack/config-global-bluebird')(),
      require('@easy-webpack/config-global-regenerator')(),
      require('@easy-webpack/config-generate-index-html')(),

      require('@easy-webpack/config-test-coverage-istanbul')(),

      {devtool: '#inline-source-map'}
    );
    break;

  default:
  case 'development':
    process.env.NODE_ENV = 'development';
    config = generateConfig(
      baseConfig,

      require('@easy-webpack/config-env-development')(),

      require('@easy-webpack/config-aurelia')
      ({root: rootDir, src: srcDir, title: title, baseUrl: baseUrl}),

      require('@easy-webpack/config-babel')(),
      require('@easy-webpack/config-html')(),
      require('@easy-webpack/config-json')(),

      require('@easy-webpack/config-sass')
      ({filename: 'gds.css', allChunks: true, sourceMap: true}),

      require('@easy-webpack/config-fonts-and-images')(),
      require('@easy-webpack/config-global-bluebird')(),
      require('@easy-webpack/config-global-regenerator')(),
      require('@easy-webpack/config-generate-index-html')
      ({minify: false}),

      require('@easy-webpack/config-copy-files')
      ({
        patterns: [
          {from: 'favicon.ico', to: 'favicon.ico'},
          {from: 'config/**/*', to: './'}
        ]
      }),

      require('@easy-webpack/config-common-chunks-simple')
      ({appChunkName: 'app', firstChunk: 'aurelia-bootstrap'}),

      {devtool: '#inline-source-map'}
    );
    break;
}

module.exports = config;

from loader-webpack.

EisenbergEffect avatar EisenbergEffect commented on June 9, 2024

Improvements coming in next releases.

from loader-webpack.

niieani avatar niieani commented on June 9, 2024

Fixed in aurelia/skeleton-navigation#714

from loader-webpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.