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

Use lerna-alias for rollup config + fixed rollup plugins order #507

Merged
merged 1 commit into from
Dec 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"jest-serializer-html": "^4.0.1",
"jsdom": "^11.3.0",
"lerna": "^2.2.0",
"lerna-alias": "^3.0.0",
"lerna-alias": "^3.0.1",
"module-alias": "^2.0.1",
"npm-run-all": "^4.0.2",
"polished": "^1.2.1",
Expand Down
18 changes: 2 additions & 16 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import babel from 'rollup-plugin-babel'
import alias from 'rollup-plugin-alias'
import cjs from 'rollup-plugin-commonjs'
import path from 'path'
import { rollup as lernaAliases } from 'lerna-alias'

const pkg = require(path.resolve(process.cwd(), './package.json'))

Expand Down Expand Up @@ -53,22 +54,7 @@ const mainConfig = Object.assign({}, baseConfig, {
})

const umdConfig = Object.assign({}, baseConfig, {
plugins: basePlugins.concat(
alias({
emotion: path.resolve(__dirname, './packages/emotion/src/index.js'),
'emotion-utils': path.resolve(
__dirname,
'./packages/emotion-utils/src/index.js'
),
'create-emotion': path.resolve(
__dirname,
'./packages/create-emotion/src/index.js'
),
'create-emotion-styled': path.resolve(
__dirname,
'./packages/create-emotion-styled/src/index.js'
)
}),
plugins: [alias(lernaAliases())].concat(basePlugins).concat(
Copy link
Member Author

Choose a reason for hiding this comment

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

alias has to come first otherwise if we build a single package and others have their built dist files ready rollup-plugin-node-resolve will kick in first to resolve the package and the dist files will be used

putting alias first we make sure that it always "wins" and source files will be used

replace({
'process.env.NODE_ENV': JSON.stringify('production')
}),
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6163,9 +6163,9 @@ lcid@^1.0.0:
dependencies:
invert-kv "^1.0.0"

lerna-alias@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lerna-alias/-/lerna-alias-3.0.0.tgz#3e1cce3e83463fcfa42c5486d19d8edfe4035afb"
lerna-alias@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/lerna-alias/-/lerna-alias-3.0.1.tgz#dfdf2f692ebc778792425ebd66b7b9418c8c96ba"
dependencies:
glob "^7.1.2"

Expand Down