Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck on 95% emitting #55

Open
XcrossD opened this issue Jun 26, 2018 · 1 comment
Open

Stuck on 95% emitting #55

XcrossD opened this issue Jun 26, 2018 · 1 comment

Comments

@XcrossD
Copy link

XcrossD commented Jun 26, 2018

Hi, I can run webpack dev server fine, but when I use the same settings for webpack it is always stuck at 95% emitting webpackConcatPlugin. There are no errors it is just stuck there. Please help.

const webpack = require('webpack');
const path = require('path');
const ConcatPlugin = require('webpack-concat-plugin');
const WriteFilePlugin = require('write-file-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");

const htmlOutputPath = path.resolve(__dirname, '../../../linkmygoods/html');
const jsPath = path.resolve(__dirname, '../../js');

// const devMode = process.env.NODE_ENV !== 'production'

module.exports = {
  output: {
    filename: 'bundle.js',
    path: path.resolve(htmlOutputPath, 'Resources'),
    libraryExport: "default"
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader"
        }
      },
      {
        test: /\.png$/,
        include: [path.resolve(htmlOutputPath, 'images')],
        loader: 'url-loader'
      },
      {
        test: /\.svg$/,
        include: [path.resolve(htmlOutputPath, 'images')],
        loader: 'url-loader',
      },
      {
        test: /\.svg$/,
        exclude: [path.resolve(htmlOutputPath, 'images')],
        loader: 'svg-inline-loader'
      },
      {
        test: /\.scss$/,
        use: [
          MiniCssExtractPlugin.loader,
          // devMode ? 'style-loader' : MiniCssExtractPlugin.loader,
          // 'style-loader', // creates style nodes from JS strings
          {
            loader: 'css-loader', // translates CSS into CommonJS
            options: { 
              alias: {
                "../images": path.resolve(htmlOutputPath, 'images')
              } 
            }
          },
          'sass-loader' // compiles Sass to CSS
        ]
      }
    ]
  },
  resolve: {
    alias: {
      moment: path.resolve(__dirname, 'node_modules/moment/moment.js'),
      SESSION: path.resolve(jsPath, 'Util/SESSION.js'),
      'node-calendar': path.resolve(__dirname, 'node_modules/node-calendar/node-calendar.js')
    }
  },
  plugins: [
    new webpack.ProvidePlugin({
      moment: 'moment',
      SESSION: 'SESSION',
      calendar: 'node-calendar'
    }),
    new ConcatPlugin({
        sourceMap: false,
        name: 'result',
        outputPath: path.resolve(htmlOutputPath, 'Resources'),
        fileName: 'legacy.js',
        filesToConcat: [
          // 'jquery',
          [
            path.resolve(jsPath, 'Util/Util.js'),
            path.resolve(jsPath, 'Util/String.js'),
            path.resolve(jsPath, 'Util/Custom.js'),
            path.resolve(jsPath, 'Util/ArrayConvertible.js')
          ],
          [
            path.resolve(jsPath, 'DBObject/Common.js'),
            path.resolve(jsPath, 'DBObject/DBObject.js'),
            path.resolve(jsPath, 'DBObject/DBFile.js'),
            path.resolve(jsPath, 'DBObject/DBObjectRegister.js'),
            path.resolve(jsPath, 'DBObject/DBObjectListRegister.js'),
            path.resolve(jsPath, 'DBObject/Item/Item.js'),
            path.resolve(jsPath, 'DBObject/Company/Company.js'),
            path.resolve(jsPath, 'DBObject/Order/Order.js'),
            path.resolve(jsPath, 'DBObject/Order/Quote.js'),
            path.resolve(jsPath, 'DBObject/Order/Shipment.js')
          ],
          [
            path.resolve(jsPath, 'Default/Handler/Handler.js'),
            path.resolve(jsPath, 'Util/Ajax.js'),
            path.resolve(jsPath, 'Util/Ajax/Currency.js')
          ],
          [
            path.resolve(jsPath, 'Default/GUI/GUIObject.js'),
            path.resolve(jsPath, 'Default/Module/Module.js'),
            path.resolve(jsPath, 'Default/Module/DefaultModule.js'),
            path.resolve(jsPath, 'Default/Module/Item/Item.js'),
            path.resolve(jsPath, 'Default/Module/Order/Common.js'),
            path.resolve(jsPath, 'Default/Module/Order/Quote.js'),
            path.resolve(jsPath, 'Default/Module/Order/Order.js'),
            path.resolve(jsPath, 'Default/Progress/Progress')
          ],
          [
            path.resolve(jsPath, 'Util/Webshop.js')
          ]
        ],
        attributes: {
            async: true
        }
    }),
    new MiniCssExtractPlugin({
      // Options similar to the same options in webpackOptions.output
      // both options are optional
      // filename: "[name].css",
      // chunkFilename: "[id].css"
      filename: path.resolve(htmlOutputPath, 'Resources/bundle.css'),
      publicPath: path.resolve(__dirname, '../../html/images')
    }),
    new WriteFilePlugin()
  ],
  externals: {
    Cookies: "Cookies",
  },
  devServer: {
    proxy: {
      '/Ajax': 'http://192.168.56.102',
      '/Download': 'http://192.168.56.102'
    },
    // contentBase: path.resolve(htmlOutputPath, '../app/View/Script/Page/NewWebshop'),
    contentBase: path.resolve(__dirname, '../../app/View/Script/Page/NewWebshop'),
    publicPath: "http://localhost:8080",
    filename: 'bundle.js'
  }
};
@VRuzhentsov
Copy link

VRuzhentsov commented Oct 18, 2018

@XcrossD this plugin is not familiar with path.resolve() in outputPath, try to use relative path

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

No branches or pull requests

2 participants