Git Product home page Git Product logo

butternut-webpack-plugin's People

Contributors

balthazar avatar ramasilveyra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

butternut-webpack-plugin's Issues

error: The final argument to magicString.overwrite(...) should be an options object

In our big webpack build we have this error, sadly due to copyright i cannot give you our source code, i could send you the webpack config if it helps.

The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string

/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/IfStatement.js:41
		return this.alternate.getLeftHandSide();
                       ^
TypeError: Cannot read property 'getLeftHandSide' of null
    at Node.getLeftHandSide (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/IfStatement.js:41:24)
    at Node.getLeftHandSide (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/BlockStatement.js:101:24)
    at Node.prepend (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Node.js:136:27)
    at Node.parenthesize (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Node.js:131:8)
    at Node.rewriteAsTernaryExpression (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/IfStatement.js:325:55)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/IfStatement.js:236:10)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/BlockStatement.js:226:15)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/shared/FunctionNode.js:108:13)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/ObjectExpression.js:20:13)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Node.js:121:32)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/CallExpression.js:132:15)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Node.js:124:12)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/AssignmentExpression.js:56:15)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/VariableDeclaration.js:80:21)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/BlockStatement.js:226:15)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/shared/FunctionNode.js:108:13)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/ParenthesizedExpression.js:100:14)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Node.js:121:32)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/shared/Array.js:46:15)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Node.js:121:32)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/types/CallExpression.js:132:15)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Node.js:124:12)
    at Node.minify (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/BlockStatement.js:226:15)
    at Program (/Users/ronald/Development/withlocals/node_modules/butternut/src/program/Program.js:59:12)
    at squash (/Users/ronald/Development/withlocals/node_modules/butternut/src/index.js:20:9)
    at Compilation.compilation.plugin (/Users/ronald/Development/withlocals/node_modules/butternut-webpack-plugin/dist/index.js:39:57)
    at Compilation.applyPluginsAsyncSeries (/Users/ronald/Development/withlocals/node_modules/webpack/node_modules/tapable/lib/Tapable.js:206:13)
    at self.applyPluginsAsync.err (/Users/ronald/Development/withlocals/node_modules/webpack/lib/Compilation.js:640:10)
    at next (/Users/ronald/Development/withlocals/node_modules/webpack/node_modules/tapable/lib/Tapable.js:202:11)
    at Compilation.<anonymous> (/Users/ronald/Development/withlocals/node_modules/extract-text-webpack-plugin/dist/index.js:272:11)

SyntaxError: 'with' in strict mode

I'm getting the following error:

/node_modules/butternut/dist/butternut.cjs.js:4111
		throw err;
		^
SyntaxError: 'with' in strict mode (53548:0) 
at Parser.pp$4.raise (/node_modules/butternut/node_modules/acorn/dist/acorn.js:2549:13)

node v6.11.0
webpack 2.3.3

Update
Looks like it's related to this issue: Rich-Harris/butternut#138

Cannot read property minify of null

Hey! Thanks for the lib.

I might be totally missing something, but when I installed from npm all I got was the README.md and the package.json. It could be because npm inherits the .gitignore config if it's available, so a blank .npmignore should override it, in my experience.

Happy to make a PR, but figured that you'd want to determine what else npm ignores and it's tiny tiny change ๐Ÿ˜›


UPDATE: I had manually compiled this lib locally and ran into errors, a la:

NODE_ENV=production webpack --config webpack.production.config.js -p

/Users/eric.bailey/Sites/quanta-server/node_modules/butternut-webpack-plugin/node_modules/butternut/dist/butternut.cjs.js:1662
				this.alternate.minify( code );

I just needed to remov the -p flag from the webpack command. My bad! Updating here in case it helps someone else.

TypeError: ButternutWebpackPlugin is not a constructor

TypeError: ButternutWebpackPlugin is not a constructor

my code in webpack config:

const ButternutWebpackPlugin = require('butternut-webpack-plugin');
config.plugins.push(
  new ButternutWebpackPlugin({}),
  new webpack.optimize.UglifyJsPlugin({
    compress: {
      warnings: false
    }
  })
)

any suggestions?

TypeError: chunk.isInitial is not a function

Hello,

I tried using the plugin, but got an error saying that "chunk.isInitial is not a function".

I'm using:

node: 12.9.0
webpack: 4.39.2
webpack-cli: 3.3.7

My config is the same as the readme example:

const ButternutWebpackPlugin = require("butternut-webpack-plugin").default;

module.exports = {
    plugins: [
        new ButternutWebpackPlugin({}),
    ],
};

With nothing else because I take advantage of default values

I guess this is an incompatibility with webapck@4 because I also have a warning "DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead"

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.