Code Monkey home page Code Monkey logo

Comments (11)

AdamJo avatar AdamJo commented on May 25, 2024 3

I'm using this boilerplate for a project and attempted to update to Webpack 2.

@developit I'll leave the Forked version here in case you may want to reference the changes.

One issue has popped up so far. The class names are not being imported correctly in the /src/components/. It seems import style from "./styles.less" is returning an empty object. The classes are in the build file correctly which means it is loading them but it is not getting to the index.js files. This may be an issue with extract-text-webpack-plugin since it is still in RC and has a few issues right now.

All of the .less files in the /style folder (global) seem to be loading fine.

Besides that, everything else seems to compile correctly.

from preact-boilerplate.

AdamJo avatar AdamJo commented on May 25, 2024 2

Sounds good. The PR can be found here.

from preact-boilerplate.

developit avatar developit commented on May 25, 2024

It's on the todo list now! We'll use this issue to track progress.

from preact-boilerplate.

developit avatar developit commented on May 25, 2024

Nice! I'll check your fork and see if I can fix.

from preact-boilerplate.

bmatzner avatar bmatzner commented on May 25, 2024

@AdamJo enable css modules extraction via the modules option on the css-loader in your webpack config:
… { loader: 'css-loader', options: { modules: true, sourceMap: true, } }

from preact-boilerplate.

AdamJo avatar AdamJo commented on May 25, 2024

Sorry for not following up on this. @bmatzner thanks for the catching that.

@developit I have made a new fork and updated from master. Webpack and Webpack-Dev-Server upgrade to version 2 and working as intended. Each commit has a link to the migration notes on webpack.js.org and some details. Let me know if you want me to open a pull request.

preact-boilerplate webpack 2 fork

from preact-boilerplate.

developit avatar developit commented on May 25, 2024

Awesome, I will take a peek at this tomorrow. If the bundle size doesn't get larger and everything still works, we can merge it and get everyone using webpack 2 :)

from preact-boilerplate.

AdamJo avatar AdamJo commented on May 25, 2024

@developit I never heard back so I've been keeping the boilerplate updated. The bundle sizes are the same.

bundle.js: 7.3kb both
style.css: 887b both
npm run test and npm run lint are working as intended.

Let me know if you would want me to open a PR to merge it.

from preact-boilerplate.

developit avatar developit commented on May 25, 2024

Definitely, let's get a PR in. I don't see any good reason to stay on Webpack 1 if the sizes are the same!

from preact-boilerplate.

ry5n avatar ry5n commented on May 25, 2024

Since #158 was merged it looks like this can be closed.

from preact-boilerplate.

developit avatar developit commented on May 25, 2024

Yup!

from preact-boilerplate.

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.