Skip to content

Commit

Permalink
started on mini-css-extract-plugin but causes tests not to run... :/
Browse files Browse the repository at this point in the history
  • Loading branch information
devlinjunker committed Apr 29, 2020
1 parent b0b0539 commit 07b5c8a
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 3 deletions.
2 changes: 2 additions & 0 deletions karma.conf.js
Expand Up @@ -9,6 +9,8 @@ const env = {
const webpack = buildWebpack(env);
webpack.watch = true;

console.log('TEST');

const karmaConfig = function(config) {
config.set({

Expand Down
95 changes: 94 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -76,6 +76,7 @@
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^3.0.5",
"list-selectors": "^2.0.0",
"mini-css-extract-plugin": "^0.9.0",
"mocha": "^6.2.3",
"normalize.css": "^8.0.1",
"postcss-exclude-files": "^1.0.15",
Expand Down
6 changes: 6 additions & 0 deletions test/test.bootstrap.js
Expand Up @@ -7,9 +7,15 @@ chai.use(sinonChai);
global.expect = chai.expect;
global.sandbox = sinon.createSandbox();

console.log('TEST');

// $FlowFixMe
const testsContext = require.context('../src', true, /.spec$/);

console.log('TEST');
console.log(testsContext);
console.log('\n\n\n TESTING');

testsContext.keys().forEach(testsContext);

/* eslint-disable mocha/no-top-level-hooks,mocha/no-hooks-for-single-case */
Expand Down
12 changes: 10 additions & 2 deletions webpack.config.js
Expand Up @@ -6,6 +6,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const FlowWebpackPlugin = require('flow-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const WriteFilePlugin = require('write-file-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
Expand Down Expand Up @@ -65,6 +66,8 @@ module.exports = (env) => {
chunks: ['storage']
}),

new MiniCssExtractPlugin(),

// Run Flow on Webpack Compile
new FlowWebpackPlugin({
failOnError: false,
Expand Down Expand Up @@ -119,8 +122,11 @@ module.exports = (env) => {
{
test: /\.css$/,
use: [
// {
// loader: 'style-loader',
// },
{
loader: 'style-loader',
loader: MiniCssExtractPlugin.loader
},
{
loader: 'css-loader',
Expand All @@ -130,7 +136,7 @@ module.exports = (env) => {
},
{
loader: 'postcss-loader'
}
},
]
},

Expand Down Expand Up @@ -181,5 +187,7 @@ module.exports = (env) => {
});
}

console.log('TEST1');

return config;
};

0 comments on commit 07b5c8a

Please sign in to comment.