ixkaito / frasco

Quick starter for Jekyll including full setup for Sass, PostCSS, Autoprefixer, stylelint, TypeScript, Webpack, ESLint, imagemin, Browsersync, etc.
https://ixkaito.github.io/frasco/
MIT License
131 stars 20 forks source link

Remove gulp-uglify #34

Closed ixkaito closed 5 years ago

ixkaito commented 5 years ago

webpack v4+ will minify your code by default in production mode.

Nsokyi commented 5 years ago

Is there way to get webpack not to neaten up my js until it's in production mode/build?

edheltzel commented 5 years ago

@Nsokyi Inside of the frasco.config.js you can set the tasks for webpack to false.

  tasks: {
    browsersync: true,
    eslint:      true,
    imagemin:    true,
    sass:        true,
    watch:       true,
    webpack:     false,
  },
Nsokyi commented 5 years ago

Thanks, I tried that and oddly enough it doesn't have any effect?

ixkaito commented 5 years ago

@Nsokyi If you set webpack to false, webpack will not do anything, so you have to directly edit your js files in the assets/js folder. Note: if you reset webpack to true, your js files in assets/js will be overwritten by files with the same name in assets/_js.

I'm sorry that for now, there's no way to switch minification between development and production.

Nsokyi commented 5 years ago

OK, thanks for getting back to me.

ixkaito commented 5 years ago

@Nsokyi On the latest release, I removed gulp-uglify because Webpack automaticlly compress js files. For now, you can add a Webpack configuration devtool: 'source-map' to frasco.config.js to enable source maps. This might make your debug easier.

  webpack: {
    mode:   'production',
    devtool: 'source-map',
    module: {
      rules: [],
    },
  },