prestarocket-agence / classic-rocket

Classic Rocket is a rework of "classic theme". It has been built keeping in mind : performance, accessibility and SEO.
https://demoprestashop.prestarocket.com/
Other
229 stars 127 forks source link

Issue when update to webpack 4 and all plugins #75

Closed msaustral closed 4 years ago

msaustral commented 5 years ago

Hi there is an issue when you update to webpack 4 and all plugins and dependencies, here is the new webpack configuration:

webpack.config.js

`/**

let config = { optimization: { minimizer: [ new TerserPlugin({ terserOptions: { sourceMap: true, compress: { sequences: true, conditionals: true, booleans: true, if_return: true, join_vars: true, drop_console: true }, output: { comments: true }, minimize: false }, }), ], }, entry: { main: [ './js/theme.js', './css/theme.scss' ] }, output: { path: path.resolve(__dirname, '../assets/js'), filename: 'theme.js', sourceMapFilename: '[file].map' }, devtool: 'source-map', plugins: [ new MiniCssExtractPlugin({ // Options similar to the same options in webpackOptions.output // both options are optional filename: '../css/theme.css', }), ], module: { rules: [ { test: /.js/, loader: 'babel-loader' }, { test: /.(sa|sc|c)ss$/, use: [ { loader: MiniCssExtractPlugin.loader, options: { sourceMap: true } }, { loader: 'css-loader', options: { sourceMap: true } }, { loader: 'postcss-loader', options: { sourceMap: true, plugins: function() { return [ require('autoprefixer') ] } } }, { loader: 'sass-loader', options: { sourceMap: true } }

    ],
  },
  {
    test: /.(png|woff(2)?|eot|ttf|svg|gif)(\?[a-z0-9=\.]+)?$/,
    use: [
      {
        loader: 'file-loader',
        options: {
          name: '../css/[hash].[ext]',
          sourceMap: true
        }
      }
    ]
  }
]

}, externals: { prestashop: 'prestashop', $: '$', jquery: 'jQuery' } };

module.exports = config; `

package.json

{ "name": "xxxxxxx", "version": "1.0.0", "description": "Tema de xxxxxx", "main": "index.js", "scripts": { "build": "webpack --mode production --progress --colors --debug --display-chunks", "watch": "webpack --mode development --progress --colors --debug --display-chunks --watch" }, "author": "Ausral", "license": "AFL-3.0", "devDependencies": { "@babel/core": "^7.5.4", "ajv": "^6.9.1", "autoprefixer": "^9.4.4", "babel-loader": "^8.0.6", "bootstrap": "4.3.1", "bootstrap-touchspin": "^4.2.5", "css-loader": "^3.0.0", "expose-loader": "^0.7.3", "file-loader": "^4.0.0", "flexibility": "^1.0.5", "gulp": "^4.0.0", "gulp-autoprefixer": "^6.0.0", "gulp-replace": "^1.0.0", "gulp-sass": "^4.0.2", "gulp-sourcemaps": "^2.6.5", "jquery": "^3.4.1", "lazysizes": "4.1.5", "material-design-icons": "^2.1.3", "mini-css-extract-plugin": "^0.7.0", "node-sass": "^4.5.0", "popper.js": "^1.14.3", "postcss-flexibility": "^2.0.0", "postcss-loader": "^3.0.0", "sass-loader": "^7.1.0", "style-loader": "^0.14.0", "terser-webpack-plugin": "^1.3.0", "webpack": "^4.35.3", "webpack-cli": "^3.3.5", "webpack-dev-server": "^3.7.2", "webpack-sources": "^0.1.0" }, "dependencies": { "babel-preset-react": "^6.24.1" } }

prestarocket commented 4 years ago

i m working on it