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

WIP - Stencil 3245 #972

Closed
wants to merge 3 commits into from
Closed

WIP - Stencil 3245 #972

wants to merge 3 commits into from

Conversation

mjschock
Copy link
Contributor

DO NOT MERGE THIS YET!!!

What?

Webpack 2 w/ Tree Shaking of lodash

Tickets / Documentation

Depends On

Notes

Before:

screen shot 2017-03-17 at 12 44 03 pm

After:

screen shot 2017-03-17 at 11 51 01 am

Thank you @dstaley for the incredibly useful writeup here.

@bigcommerce/stencil-team

compact: false,
cacheDirectory: true,
presets: [
['latest', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you looked at using babel-preset-env instead of using latest? It ties in really nicely with the autoprefixer list already used in Stencil. It's the same basic functionality as latest, but lets you keep some of the newer stuff provided your target browsers are fairly modern.

var webpack = require('webpack');
var config = require('./config');

module.exports = {
    devtool: 'source-map',
    bail: true,
    module: {
        loaders: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
                include: /(assets\/js|assets\\js|node_modules\/@bigcommerce\/stencil-utils|node_modules\\@bigcommerce\\stencil-utils)/,
                query: {
                    compact: false,
                    cacheDirectory: true,
                    presets: [
                        ['env', {
                            'targets': {
                                'browsers': config['autoprefixer_browsers'],
                                'uglify': true
                            }
                        }],
                        'stage-3'
                    ],
                    plugins: ['transform-react-jsx']
                }
            }
        ]
    },
    plugins: [
        new webpack.ProvidePlugin({
            $: 'jquery',
            jQuery: 'jquery',
            'window.jQuery': 'jquery'
        })
    ],
    watch: false
};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dstaley - yes, there's actually one more PR coming where we'll be using the 'dev' preset instead of 'latest'. i'm working on it right now. :) thanks again for your article!

@mjschock
Copy link
Contributor Author

closing this as it's being merged into #964 instead.

@mjschock mjschock closed this Mar 21, 2017
@mjschock mjschock deleted the STENCIL-3245 branch March 21, 2017 17:26
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

Successfully merging this pull request may close these issues.

3 participants