Updating WebPack 1 to WebPack 3 -
i concept behind this boilerplate of separating frontend backend. trying update whole boilerplate starting webpack. version included in boilerplate webpack 1. tried upgrading version 3.
apparently need upgrade version 2 since upgrading version 3 smooth , done through command line via updating webpack only. followed official guide , other separate ressources of course try modify webpack.config.js file. ended followong webpack.config.js file:
still when run npm start fron client side following error:
this debug file npm.
var sgrid = require('s-grid'); var rupture = require('rupture'); var autoprefixer = require('autoprefixer'); var path = require('path'); var webpack = require('webpack'); var htmlwebpackplugin = require('html-webpack-plugin'); module.exports = { devtool: 'eval', entry: [ 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', './app/app.js' ], output: { pathinfo: true, path: path.resolve(__dirname, 'public'), filename: 'bundle.js', publicpath: 'http://localhost:3000/' }, plugins: [ new webpack.loaderoptionsplugin({ options: { //postcss: [autoprefixer], context: __dirname, minimize: true //stylus: [sgrid, rupture] } }), new htmlwebpackplugin({ title: 'react webpack , redux - meteor backend only!', template: './index_template.ejs', inject: 'body' }), new webpack.hotmodulereplacementplugin(), new webpack.optimize.uglifyjsplugin({ sourcemap: true, //in webpack 2 defaults false need explicitly set. compress: { warnings: true } }) ], module: { rules: [ { test: /\.js$/, exclude: /(node_modules|bower_components)/, use: ['babel-loader'] //'use' , 'loaders' interchangeable }, { test: /\.css$/, //scss?? use: [ { loader: 'style-loader' }, { loader: 'css-loader', options: { sourcemap: true, importloaders: 2, localidentname: '[name]__[local]__[hash:base64:5]', //plugins: autoprefixer,//wtf?? } }, { loader: 'postcss-loader', options: { plugins: function(){ return [autoprefixer] } } } ] //loader: 'style!css?sourcemap&importloaders=2&localidentname=[name]__[local]__[hash:base64:5]!postcss' }, { test: /\.styl$/, exclude: /(node_modules|bower_components)/, use: [ { loader: 'style-loader' }, { loader: 'css-loader', options:{ sourcemap: true, modules: true, importloaders: 2, localidentname: '[name]__[local]__[hash:base64:5]' //plugins: sgrid, rupture } }, { loader: 'postcss-loader', options: { plugins: function(){ return [autoprefixer] } } }, { loader: 'stylus-loader', options: { plugins: function(){ return [sgrid, rupture] } } } ] // loader: 'style!css?sourcemap&modules&importloaders=2&localidentname=[name]__[local]__[hash:base64:5]!postcss!stylus-loader' }, { test: /\.(png|jpg)$/, exclude: /(node_modules|bower_components)/, use: [ { loader: 'url-loader', options:{ name: 'images/[name].[ext]', limit: '8192' //maybe int???? } } ] //loader: 'url-loader?name=images/[name].[ext]&limit=8192' } ] }, resolve: { //root: path.join(__dirname, '..', 'app'), modules: [ path.join(__dirname, "app"), // 2 or 3 arguments?? "node_modules" ], extensions: ['.js', '.jsx', '.json', '.css', '.styl', '.png', '.jpg', '.jpeg', '.gif'], enforcemoduleextension: false }, /* stylus: function () { return [sgrid, rupture] },*/ /* postcss: function () { return [autoprefixer]; }*/ };
i highly appreciate kind of on issue.
Comments
Post a Comment