Coder Social home page Coder Social logo

Comments (12)

AdamBrodzinski avatar AdamBrodzinski commented on September 24, 2024

When you say all, if you comment out the file does another one throw?

from meteor-webpack-react.

AdamBrodzinski avatar AdamBrodzinski commented on September 24, 2024

Try removing the uglify plugin from the prod config.... Meteor is going to minify it anyway unless the minified package is taken out manually.

from meteor-webpack-react.

tomitrescak avatar tomitrescak commented on September 24, 2024

I can confirm that removing uglify in prod helped:

// file: webpack.config.client.prod.js
var webpack = require('webpack');
var config = require('./webpack.config.client');
var _ = require('lodash');

var config = module.exports = _.assign(_.cloneDeep(config), {
  plugins: (config.plugins || []).concat([
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: JSON.stringify('production'),
      }
    }),
    new webpack.NoErrorsPlugin(),
    new webpack.optimize.DedupePlugin(),
    // new webpack.optimize.UglifyJsPlugin({
    //   compress: { warnings: false }
    // }),
    new webpack.optimize.AggressiveMergingPlugin(),
    new webpack.optimize.OccurenceOrderPlugin(true),
  ]),
});

from meteor-webpack-react.

tomitrescak avatar tomitrescak commented on September 24, 2024

Althought I'm puzzeled by this ;/ I am using template strings all around my project, but the only file it reallly minds is where my i18n strings are stored. I tried to move theimport around my project but no success.

I have in my router.tsx two imports

import "./someother" // has template strings and life is good
import "./i18n" // has template strings and life is miserable

Do you have any idea of why uglify and everything else would complain?

from meteor-webpack-react.

jedwards1211 avatar jedwards1211 commented on September 24, 2024

Huh. That's odd because all backticks for template strings should be compiled out into ES5 by babel. Can you copy and paste that line from i18n.en.jsx?

from meteor-webpack-react.

tomitrescak avatar tomitrescak commented on September 24, 2024

Here it goes

mf["languages"].en = {
  "activity": "Activity",
  "add": "Add",
}

mf["languages"].en["privacyPolicy.text"] = `
This privacy policy has been compiled to better serve those who are concerned with how their 'Personally identifiable information' (PII) is being used online. PII, as used in privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

**What personal information do we collect from the people that visit our blog, website or app?**

When ordering or registering on our site, as appropriate, you may be asked to enter your name, email address, mailing address or other details to help you with your experience.

**When do we collect information?**

We collect information from you when you register on our site or enter information on our site.
...`

from meteor-webpack-react.

jedwards1211 avatar jedwards1211 commented on September 24, 2024

Huh, maybe there's a bug when transpiiling multiline strings like that? you should be able to take a look at the transpiled output you get without UglifyJS and see if it contains a ` character

from meteor-webpack-react.

tomitrescak avatar tomitrescak commented on September 24, 2024

@jedwards1211 I'm transpiling to ES6. So the ` symbol is preserved in all output *.js files. The weird part is, that it only complains in some of the *.js files, while others are fine.

from meteor-webpack-react.

jedwards1211 avatar jedwards1211 commented on September 24, 2024

Huh, well, I have no idea if UglifyJS works on ES6. I wouldn't assume it does; do you know if it's officially supposed to?

from meteor-webpack-react.

jedwards1211 avatar jedwards1211 commented on September 24, 2024

Is it practical to use some ES6 features in the browser yet? I haven't really been keeping up with this yet

from meteor-webpack-react.

tomitrescak avatar tomitrescak commented on September 24, 2024

I misunderstood ... it is the babel that does not pick up those template strings and I'm not sure why. Then the uglify freaks out. So it must be a bug in babel as in some files it transpiles template strings to es5 and in some not :/

from meteor-webpack-react.

jedwards1211 avatar jedwards1211 commented on September 24, 2024

Ah, yeah, I was wondering if it maybe has bugs with multiline ` strings. Anyway, I'll close this issue

from meteor-webpack-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.