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

Exclude src folder from the published package #1185

Closed
limonte opened this issue Jul 27, 2018 · 3 comments
Closed

Exclude src folder from the published package #1185

limonte opened this issue Jul 27, 2018 · 3 comments
Assignees

Comments

@limonte
Copy link
Member

limonte commented Jul 27, 2018

Follow-up from #1160

In order to avoid any confusions, src folder should be excluded from the published package.

The correct way to import Swal without styles is

import Swal from 'sweetalert2/dist/sweetalert2.js'

As the nice bonus: the bundle size will be slightly smaller:

Before:

npm pack
npm notice package size:  114.1 kB
npm notice unpacked size: 517.1 kB
npm notice total files:   69

After:

npm pack
npm notice package size:  93.9 kB
npm notice unpacked size: 439.0 kB
npm notice total files:   16
@limonte limonte added the needs: breaking change Solving this issue/merging this PR would cause a breaking change label Jul 27, 2018
@limonte limonte self-assigned this Jul 27, 2018
@zenflow
Copy link
Member

zenflow commented Sep 24, 2018

Unforeseen detail here: What about the scss files located under src/? I would think we want to continue to ship those in the package, since probably a lot of people are customizing the variables and @importing "../../node_modules/src/sweetalert2.scss" in their own sass code.

@limonte
Copy link
Member Author

limonte commented Sep 24, 2018

Unforeseen detail here: What about the scss files located under src/?

Good point. Should we separate them into scss folder? I was never comfortable with scss and js files mixed in one folder.

I'm opened for the folder name discussion. To be explicit, we can go with scss, or, to be fancier, stylesheets could be an option (inspired by http://thesassway.com/beginner/how-to-structure-a-sass-project)

@limonte
Copy link
Member Author

limonte commented Jan 8, 2019

As discussed in #1281 (comment) we need src files because we want to provide the ability to import uncompiled files (e.g. for security reasons).

As for scss files, well it would be better to have them separately, but there are no strong reasons to bring another one breaking change.

So, wontfix.

@limonte limonte closed this as completed Jan 8, 2019
@limonte limonte added resolution: won't fix and removed needs: breaking change Solving this issue/merging this PR would cause a breaking change labels Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants