ember-cli-code-coverage icon indicating copy to clipboard operation
ember-cli-code-coverage copied to clipboard

Duplicate plugin/preset detected. In Ember engine's inside inRepoEngine /test_client/lib/test-admin/index.js

Open raghu069 opened this issue 1 year ago • 0 comments

In test_client/package.json

"ember-cli-babel": "^8.2.0",
"ember-cli-code-coverage": "^3.0.1",

In test_client/ember-cli-build.js

 let app = new EmberAddon(defaults, {
    // Add options here
    autoImport: {
      insertScriptsAt: 'auto-import-scripts',
      webpack: {
        externals: {
          'jquery': 'jQuery'
        }
      }
    },
    babel: {
      plugins: [...require('ember-cli-code-coverage').buildBabelPlugin()]
    },

In test_client/index.js

included(app) {
    this._super.included.apply(this, arguments);
    if (this.project.pkg.name === this.name) {
        this.options.babel.plugins.push(...require('ember-cli-code-coverage').buildBabelPlugin());
    }
}

The below one is added In /test_client/lib/test-admin/index.js [In repo Engine]

included: function(/* app */) {
    this._super.included.apply(this, arguments);
    if (this.project.pkg.name === this.name) {
      this.options.babel.plugins.push(...require('ember-cli-code-coverage').buildBabelPlugin()); //NO I18N
    }
  },

But it show error "Duplicate plugin/preset detected. If you'd like to use two separate instances of a plugin, they need separate names, e.g. plugins: [ ['some-plugin', {}], ['some-plugin', {}, 'some unique name'], ] " error

raghu069 avatar Oct 04 '24 08:10 raghu069