@@ -227,7 +227,6 @@ module.exports = {
227227 test: /\\\\\\\\.(js|jsx)$/,
228228 loader: 'babel-loader',
229229 },
230-
231230 {
232231 test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
233232 type: 'asset',
@@ -345,7 +344,6 @@ module.exports = {
345344 loader: 'ts-loader',
346345 exclude: ['/node_modules/'],
347346 },
348-
349347 {
350348 test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
351349 type: 'asset',
@@ -400,9 +398,8 @@ module.exports = {
400398 rules: [
401399 {
402400 test: /\\\\.less$/i,
403- loader: 'less-loader',
401+ use: [ 'less-loader'] ,
404402 },
405-
406403 {
407404 test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
408405 type: 'asset',
@@ -436,7 +433,65 @@ module.exports = {
436433 test: /\\\\.css$/i,
437434 use: ['style-loader', 'css-loader', 'postcss-loader'],
438435 },
436+ {
437+ test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
438+ type: 'asset',
439+ },
440+
441+ // Add your rules for custom modules here
442+ // Learn more about loaders from https://webpack.js.org/loaders/
443+ ],
444+ },
445+ };
446+ "
447+ `;
448+
449+ exports[`init command should use sass and css with postcss in project when selected 1`] = `
450+ Object {
451+ "description": "My webpack project",
452+ "devDependencies": Object {
453+ "autoprefixer": "x.x.x",
454+ "css-loader": "x.x.x",
455+ "postcss": "x.x.x",
456+ "postcss-loader": "x.x.x",
457+ "sass": "x.x.x",
458+ "sass-loader": "x.x.x",
459+ "style-loader": "x.x.x",
460+ "webpack": "x.x.x",
461+ "webpack-cli": "x.x.x",
462+ },
463+ "name": "my-webpack-project",
464+ "scripts": Object {
465+ "build": "webpack --mode=production",
466+ },
467+ "version": "1.0.0",
468+ }
469+ `;
439470
471+ exports[`init command should use sass and css with postcss in project when selected 2`] = `
472+ "// Generated using webpack-cli http://github.com/webpack-cli
473+ const path = require('path');
474+
475+ module.exports = {
476+ mode: 'development',
477+ entry: './src/index.js',
478+ output: {
479+ path: path.resolve(__dirname, 'dist'),
480+ },
481+ plugins: [
482+ // Add your plugins here
483+ // Learn more obout plugins from https://webpack.js.org/configuration/plugins/
484+ ],
485+ module: {
486+ rules: [
487+ {
488+ test: /\\\\.s[ac]ss$/i,
489+ use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
490+ },
491+ {
492+ test: /\\\\.css$/i,
493+ use: ['style-loader', 'css-loader', 'postcss-loader'],
494+ },
440495 {
441496 test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
442497 type: 'asset',
@@ -490,7 +545,59 @@ module.exports = {
490545 test: /\\\\.s[ac]ss$/i,
491546 use: ['style-loader', 'css-loader', 'sass-loader'],
492547 },
548+ {
549+ test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
550+ type: 'asset',
551+ },
552+
553+ // Add your rules for custom modules here
554+ // Learn more about loaders from https://webpack.js.org/loaders/
555+ ],
556+ },
557+ };
558+ "
559+ `;
560+
561+ exports[`init command should use sass with postcss in project when selected 1`] = `
562+ Object {
563+ "description": "My webpack project",
564+ "devDependencies": Object {
565+ "autoprefixer": "x.x.x",
566+ "postcss": "x.x.x",
567+ "postcss-loader": "x.x.x",
568+ "sass": "x.x.x",
569+ "sass-loader": "x.x.x",
570+ "webpack": "x.x.x",
571+ "webpack-cli": "x.x.x",
572+ },
573+ "name": "my-webpack-project",
574+ "scripts": Object {
575+ "build": "webpack --mode=production",
576+ },
577+ "version": "1.0.0",
578+ }
579+ `;
493580
581+ exports[`init command should use sass with postcss in project when selected 2`] = `
582+ "// Generated using webpack-cli http://github.com/webpack-cli
583+ const path = require('path');
584+
585+ module.exports = {
586+ mode: 'development',
587+ entry: './src/index.js',
588+ output: {
589+ path: path.resolve(__dirname, 'dist'),
590+ },
591+ plugins: [
592+ // Add your plugins here
593+ // Learn more obout plugins from https://webpack.js.org/configuration/plugins/
594+ ],
595+ module: {
596+ rules: [
597+ {
598+ test: /\\\\.s[ac]ss$/i,
599+ use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader'],
600+ },
494601 {
495602 test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
496603 type: 'asset',
@@ -542,9 +649,8 @@ module.exports = {
542649 rules: [
543650 {
544651 test: /\\\\.styl$/,
545- loader: 'stylus-loader',
652+ use: [ 'stylus-loader'] ,
546653 },
547-
548654 {
549655 test: /\\\\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/,
550656 type: 'asset',
0 commit comments