Code Monkey home page Code Monkey logo

Comments (10)

ai avatar ai commented on July 24, 2024

Sure. Let's do it. Do you want to make PR?

Also, why custom config should not include compression and minification plugins? What if users will want to customize them too?

from size-limit.

indexzero avatar indexzero commented on July 24, 2024

Totally possible. I was assuming that the Compression and Uglify plugins the webpack config in index.js uses were intentional. e.g. what would happen if one attempted to use require('webpack').optimize.UglifyJsPlugin instead of require('uglifyjs-webpack-plugin')?

from size-limit.

ai avatar ai commented on July 24, 2024

uglifyjs-webpack-plugin loads latest beta with ES6 support

from size-limit.

indexzero avatar indexzero commented on July 24, 2024

Got it. What I'm trying to figure out is the best way to (or if it's feasible) to implement the following:

  • Is it possible to determine if an arbitrary webpack config object, config, needs modification by size-limit?

In other words: what's an efficient way to check if config.plugins has both a compatible minifier plugin and a compatible compression plugin?

from size-limit.

ai avatar ai commented on July 24, 2024

I think we could ignore this problem. If you pass custom config, it is your responsibility now.

If we will have a lot of issues, we can add check later.

from size-limit.

indexzero avatar indexzero commented on July 24, 2024

That's reasonable. Will take a stab at this in the next couple of weeks.

from size-limit.

SivanMehta avatar SivanMehta commented on July 24, 2024

@indexzero @ai I have submitted #29, and #31 to enable a --config flag that supports a custom webpack config.

from size-limit.

ai avatar ai commented on July 24, 2024

Released in 0.12

from size-limit.

oliviertassinari avatar oliviertassinari commented on July 24, 2024

@SivanMehta I'm wondering, how are you using this --config option? How do you handle the files option?

size-limit/index.js

Lines 32 to 49 in 2286080

if (opts.config) {
let config
if (path.isAbsolute(opts.config)) {
config = require(opts.config)
} else {
config = require(path.join(process.cwd(), opts.config))
}
let resolveModulesPaths = [
path.join(process.cwd(), 'node_modules')
]
if (!config.resolveLoader) config.resolveLoader = { }
if (!config.resolve) config.resolve = { }
config.resolveLoader.modules = resolveModulesPaths
config.resolve.modules = resolveModulesPaths
return config
}

from size-limit.

SivanMehta avatar SivanMehta commented on July 24, 2024

This PR should have supported the usage as described in the initial issue descriptions

size-limit --config ./my-custom-webpack.config.js

from size-limit.

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.