U
U
uuushka2016-07-21 12:27:52
JavaScript
uuushka, 2016-07-21 12:27:52

Why do commas disappear in texts after WebPack build?

Hello!
I ran into a problem that when building the frontend in bundle.js, commas in the text disappear.
That is, a system for displaying messages that are embedded in the project.
For example,

const dict = {
  msg1: ['Тут текст, где есть запятая']
}

in bundle.js already without a comma.
I don't even have an idea why this is happening...
Config example
import Path from 'path';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import Webpack from 'webpack';
import webpackPaths from './webpackPaths';

const { resolve } = webpackPaths;

const WebpackConfig = {
  entry: [
    Path.resolve(__dirname, 'app/app.js')
  ],
  output: {
    filename: 'bundle.js',
    path: Path.resolve(__dirname, 'build')
  },
  module: {
    loaders: [
      { test: /\.js(\?.+)?$/, exclude: /node_modules(?![\/\\]qqq-)/, loaders: ['es3ify', 'babel'] },
      { test: /\.(scss|css)(\?.+)?$/, loader: ExtractTextPlugin.extract('style', 'css!sass') },
      { test: /\.png(\?.+)?$/, loader: 'file-loader?name=./images/[hash].[ext]&mimetype=image/png' },
      { test: /\.gif(\?.+)?$/, loader: 'file-loader?name=./images/[hash].[ext]&mimetype=image/gif' },
      { test: /\.svg(\?.+)?$/, loader: 'file-loader?name=./images/[hash].[ext]&limit=10000&mimetype=image/svg+xml' },
      {
        test: /\.ttf(\?.+)?$/,
        loader: 'file-loader?name=./fonts/[hash].[ext]&limit=10000&mimetype=application/font-ttf'
      },
      {
        test: /\.woff(\?.+)?$/,
        loader: 'file-loader?name=./fonts/[hash].[ext]&limit=10000&mimetype=application/font-woff'
      },
      {
        test: /\.eot(\?.+)?$/,
        loader: 'file-loader?name=./fonts/[hash].[ext]&limit=10000&mimetype=application/vnd.ms-fontobject'
      }
    ]
  },
  resolve,
  plugins: [
    new Webpack.optimize.DedupePlugin(),
    new ExtractTextPlugin('bundle.css')
  ],
  sassLoader: {
    outputStyle: 'compressed'
  }
};

export default WebpackConfig;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2016-07-21
@uuushka

Предположу, что это все es3ify-loader.
Зачем вам поддержка динозавров?
https://github.com/spicyj/es3ify/blob/master/index...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question