-
Notifications
You must be signed in to change notification settings - Fork 0
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
new 250 #4
base: master
Are you sure you want to change the base?
new 250 #4
Changes from all commits
d2a51d5
cacd2af
7470526
57dc45b
8b2c361
5eb52e4
0257d64
f6725ec
dfdce8c
04beb4b
26142fa
b5050d1
43f2b20
6e20ee6
c4921a7
cb46946
7bbed6f
7a08d7e
d89767c
84e4a38
935d64d
520a620
4441712
cec6ed7
f861955
c8c10af
748f70b
8c9d3ef
bb596f2
e5c1f6d
fc4cc8a
9c0844b
10e1e40
f963b52
ef36954
778dcf8
c870eac
d11472c
e06030d
d4f445f
09f8a20
9e766fc
a43db69
1239cda
140a2be
9d0d289
bc67fd0
51a7ab5
6ca0591
8017061
180f038
9d8c2ec
b5e358b
acfddc9
950d991
cfaf4f0
ed7bb9d
4617fd2
960cf90
7568cd4
11330ef
bf19dd6
75b1af7
7aba1f8
1b2f0d7
d692942
ccf97b4
367ebfe
b735212
b9737a1
e83d7ee
e795fc0
430e2e5
8f552a6
dec79f7
3320c2c
134a188
e3d95e0
ed79f10
883292e
4b5c47d
3d8d58a
9af2de1
80272e9
6b2e351
59a7a9a
a843e7c
0c64fbb
3a0b60b
4170410
43f8e6b
5b3d150
447556b
f786b92
299a4a0
d7ce812
95d9f8a
0b5d5a0
deb7a34
d254cd9
2b1d198
cb91548
7a5e166
fc02134
8d4510f
9a83bba
5dcd903
891879e
ebcd85a
95952e3
c54faf0
e2e8906
d702ae0
70ca50e
79eb00f
575e288
b2042e2
2eb200d
fee0d49
ff57110
419638c
e0b4c9b
ad1c09a
1138224
55501a6
c285fbb
6cc5045
e0f1899
8c529e0
3eb4fed
659b0d1
4eb1071
3a5497d
dd16838
a6a30b2
5a40fb5
63905e1
d95473c
367f60d
50760de
42326d4
bb36fb7
799f684
2da8be2
1b145b7
ea911dc
df97f5f
c405afa
2208249
f7de8ea
9f3ccd3
11f43cf
240fd0b
d8002ca
4d1c4ad
a470082
c68c02e
0316772
3a35f01
6a448d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<link rel="stylesheet" href="node_modules/highlight.js/styles/github.css"/> | ||
<link id="nds-styles" rel="stylesheet" href="/assets/styles/index.css"></link> | ||
<style> | ||
#root { | ||
margin: 1rem; | ||
|
@@ -24,3 +25,23 @@ | |
/* THE ABOVE OVERRIDE IS PURELY FOR THE EXAMPLES IN STORYBOOK */ | ||
} | ||
</style> | ||
<script> | ||
(function() { | ||
const storybookEventSource = new EventSource(`${location.protocol}//${location.host}/__webpack_hmr`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: This EventSource might not be available in all environments. Consider adding a fallback |
||
const newportStorybookStyles = document.getElementById('nds-styles'); | ||
storybookEventSource.onmessage = (event) => { | ||
if (event.data) { | ||
try { | ||
const data = JSON.parse(event.data); | ||
if (data.action === 'built') { | ||
setTimeout(() => { | ||
newportStorybookStyles.href = `/assets/styles/index.css?${Date.now()}`; | ||
}, 250); | ||
lizard-boy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} catch (e) { | ||
// ignore | ||
} | ||
Comment on lines
+41
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: Silently ignoring all errors could hide important issues. Consider logging or handling errors |
||
} | ||
}; | ||
})(); | ||
</script> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
const gulp = require('gulp'); | ||
const { watchPaths } = require('../scripts/watch'); | ||
const { | ||
watchPaths | ||
} = require('../scripts/watch'); | ||
require('../scripts/gulp/styles'); | ||
|
||
class NewportSassWatcherPlugin { | ||
apply(compiler) { | ||
let sassWatcher; | ||
compiler.hooks.watchRun.tap('Newport Sass Compiler', () => { | ||
const sassWatcher = gulp.watch(watchPaths.sass, gulp.series('styles:sass')); | ||
if (!sassWatcher) { | ||
sassWatcher = gulp.watch(watchPaths.sass, gulp.series('styles:sass')); | ||
|
||
sassWatcher.on('change', function(obj, stats) { | ||
console.log(`File ${obj} was changed`); | ||
}); | ||
sassWatcher.on('change', function (obj, stats) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: Consider using an arrow function for consistency with the outer function |
||
console.log(`File ${obj} was changed`); | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider using a relative path for better cross-environment compatibility