Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Can't generate a production build #42

Closed
arimourao opened this issue Nov 8, 2017 · 4 comments
Closed

Can't generate a production build #42

arimourao opened this issue Nov 8, 2017 · 4 comments

Comments

@arimourao
Copy link

arimourao commented Nov 8, 2017

I followed the instructions present in the README of this repo, but I still can't generate a production ready build. I get the following warning: It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster. See https://fb.me/react-minification for more details.

Here is my entire webpack.config.js

`
const path = require('path');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
template: './src/index.html',
filename: 'index.html',
inject: 'body'
});

module.exports = {
entry: './src/index.jsx',
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'views/panel')
},
plugins: {
uglify: {
mangle: false,
compress: {
global_defs: {
DEBUG: false
}
}
}
},
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
},
{
test: /.css$/,
loader: "style-loader!css-loader"
}
],
rules: [
{
test: /.jsx?$/,
exclude: /node_modules/,
use: [
{
loader: "babel-loader"
},
{
loader: "eslint-loader",
options: {
fix: true
}
}
]
},
{
test: /.css$/,
use: [ 'style-loader', 'css-loader' ]
},
{
test: /.(png|woff|woff2|eot|ttf|svg)(?v=[0-9].[0-9].[0-9])?$/,
loader: 'url-loader'
}
],
},
devtool: 'inline-source-map',
plugins: [
HtmlWebpackPluginConfig,
new UglifyJSPlugin()
]
};`

@paulmillr
Copy link
Contributor

Why are you mentioning Webpack in a repo for Brunch?

@arimourao
Copy link
Author

How am I supposed to run this brunch then??

@paulmillr
Copy link
Contributor

See http://brunch.io for documentation.

You are including Webpack config, which is an entirely different software and is unrelated to Brunch.

@beznosd
Copy link

beznosd commented Nov 8, 2017

Production build of react app in 3 steps with Brunch from scratch:

  1. Create folder for your new app
    $ mkdir test-app && cd test-app
  2. Use react skeleton to set up new react project. More detail about skeletons here.
    $ brunch new -s react
  3. Do a production build of your app
    $ brunch build -p

If you need to customize your build (change folder structure of the project or add some plugins or ...), you can read the docs for further details.

Enjoy using Brunch!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants