typescript - Mac Terminal: ts-loader, webpack, npm start issue: output is on same line -
as can see, string "ts-loader: using..." on same line percentage output. ask myself: "why there no line break?"
maybe of had issue, , found solution worth sharing us.
as wanted added configuration of webpack.
here webpack.config.js file...
const path = require('path'); const webpack = require('webpack'); const precss = require('precss'); const autoprefixer = require('autoprefixer'); const htmlwebpackplugin = require('html-webpack-plugin'); const forktscheckerwebpackplugin = require('fork-ts-checker-webpack-plugin'); const happypack = require('happypack'); module.exports = { node: { fs: 'empty', net: 'empty' }, entry: [ 'babel-polyfill', 'react-hot-loader/patch', 'webpack-dev-server/client?http://localhost:3000', 'webpack/hot/only-dev-server', './src/index' ], output: { path: path.join(__dirname, 'dist'), publicpath: '/', filename: 'app.[hash].js' }, resolve: { symlinks: false, modules: [ path.resolve(__dirname, 'src'), path.resolve(__dirname, 'node_modules') ], extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss', '.json', '.less'] }, devtool: 'eval-source-maps', module: { loaders: [ { test: /\.tsx?$/, exclude: /node_modules/, loader: 'ts-loader', }, { test: /\.less|css$/, use: [{ loader: 'style-loader' // creates style nodes js strings }, { loader: 'css-loader' // translates css commonjs }, { loader: 'less-loader' // compiles less css }, { loader: 'postcss-loader' // compiles less css }] }, { test: /\.(jpe?g|png|gif|svg)$/i, loaders: [ 'file-loader?hash=sha512&digest=hex&name=assets/[hash].[ext]', 'image-webpack-loader?bypassondebug&optimizationlevel=7&interlaced=false' ] }, { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff' }, { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader' }, ] }, plugins: [ new webpack.defineplugin({ 'process.env': { 'node_env': json.stringify('development') } }), new webpack.namedmodulesplugin(), new webpack.hotmodulereplacementplugin(), new webpack.progressplugin(), new htmlwebpackplugin({hash: false, template: './index.hbs'}), new webpack.loaderoptionsplugin({ test: /\.scss$/, debug: true, options: { postcss: function () { return [precss, autoprefixer]; }, context: path.join(__dirname, 'src'), output: { path: path.join(__dirname, 'dist') } } }), new happypack({ loaders: [{ path: 'ts-loader', query: {happypackmode: true} } ], threads: 6 }), new forktscheckerwebpackplugin() ] };
Comments
Post a Comment