Cannot load FR7 css bundle with webpack


#1

I try to load the next css with Webpack:
require(‘framework7/css/framework7.bundle.css’);

However I receive the next error:

client:180 ./node_modules/framework7/css/framework7.bundle.css (./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/framework7/css/framework7.bundle.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: No PostCSS Config found in: /Users/razbuchnik/Projects/taxi4you/apps/drivers/node_modules/framework7/css
    at config.load.then (/Users/razbuchnik/Projects/taxi4you/apps/drivers/node_modules/postcss-load-config/src/index.js:55:15)

This is my webpack.config.js file:

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports = (env, argv) => {
  return {
    entry: './src/webpack.entry.js',
    output: {
      filename: 'bundle.js',
      chunkFilename: '[name].bundle.js',
      path: path.resolve(__dirname, 'www')
    },
    plugins: [
      new HtmlWebpackPlugin({
        template: "./src/index.html"
      }),
    ],
    devServer: {
      contentBase: 'www'
    },
    // devtool: argv.mode == "development" ? 'inline-source-map' : false,
    module: {
      rules: [
        {
          test: /\.(html)$/,
          exclude: /node_modules/,
          use: {
            loader: 'html-loader',
            options: {
              attrs: [':data-src']
            }
          }
        },
        {
          test: /\.(woff(2)?|ttf|eot|svg|jpg|jpeg|png|jpg|gif)$/,
          exclude: /node_modules/,
          use: [
            {
              loader: 'file-loader',
              options: {}
            }
          ]
        },
        {
          test: /\.css$/,
          exclude: /node_modules/,
          use: [
            'style-loader',
            'css-loader',
          ]
        },
      ]
    },
    optimization: {
      minimize: false
    }
  };
}

#2
      test: /\.css$/,
      exclude: /node_modules/,
      loader: [
        'style-loader',
        'css-loader',
      ]

Try this, i don’t know webpack well enough, may it help :thinking:


#3

@razaviv, if this is a new project… try setting it up with the framework7 CLI . All these have been done on your behalf already… just concentrate on what you want to achieve


#4

Error message is pretty self-explaining https://stackoverflow.com/questions/41609397/uncaught-error-module-build-failed-error-no-postcss-config-found-in-ng2-adm/41758053#41758053