Skip to content

Commit

Permalink
Get Neutrino config from .neutrinorc.js file for consistent build pro…
Browse files Browse the repository at this point in the history
…cess.
  • Loading branch information
friedjoff committed May 16, 2018
1 parent f59838a commit 3fe6428
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const webpack = require("webpack");
const webpackPreprocessor = require("@cypress/webpack-preprocessor");
const imageLoader = require('@neutrinojs/image-loader');
const styleLoader = require('@neutrinojs/style-loader');

const { Neutrino } = require('neutrino');

Expand All @@ -10,10 +8,7 @@ module.exports = on => {
const olProvider = new webpack.ProvidePlugin({ ol: "openlayers" });
options.webpackOptions.plugins = [olProvider];

const neutrino = Neutrino();
neutrino.use(imageLoader);
neutrino.use(styleLoader, { extract: false });
const config = neutrino.config.toConfig();
const config = Neutrino().use('.neutrinorc.js').config.toConfig();
options.webpackOptions.module.rules.push(...config.module.rules);
on("file:preprocessor", webpackPreprocessor(options));
};

0 comments on commit 3fe6428

Please sign in to comment.