You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 1, 2020. It is now read-only.
Copy file name to clipboardexpand all lines: patternlabsite/docs/advanced-clean-public.md
+49-2
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,19 @@
2
2
layout: docs
3
3
title: Stopping public/ from Being "Cleaned" | Pattern Lab
4
4
heading: Stopping `public/` from Being "Cleaned"
5
+
languages:
6
+
- language: php
7
+
- language: node
5
8
---
6
9
7
-
**Note:***The cleanPublic configuration option was introduced in v0.7.0 of the PHP version of Pattern Lab.*
10
+
<!--- start php -->
11
+
12
+
<divclass="tab-panel"id="php">
13
+
<h2class="language-title">php</h2>
14
+
15
+
{% capture m %}
8
16
17
+
**Note:***The cleanPublic configuration option was introduced in v0.7.0 of the PHP version of Pattern Lab.*
9
18
10
19
By default the PHP version of Pattern Lab deletes most of the files and directories found in `public/` when generating your site or starting the watch. Developers are supposed to use `source/` to store their files. This includes static assets like images, JavaScript and CSS. When generating your site the PHP version of Pattern Lab moves all of the static assets found in `source/` to `public/` (_after cleaning it_) so there shouldn't be a reason not to use `source/`.
11
20
@@ -14,4 +23,42 @@ That said, developers might be more comfortable storing their static assets in `
14
23
1. Open `config/config.ini`.
15
24
2. Change the `cleanPublic` from `"true"` to `"false"`
16
25
17
-
When you next generate your site or start the watch `public/` will no longer be cleaned.
26
+
When you next generate your site or start the watch `public/` will no longer be cleaned.
27
+
28
+
{% endcapture %}
29
+
{{ m | markdownify }}
30
+
31
+
</div>
32
+
33
+
<!--- end php -->
34
+
35
+
36
+
<!--- start node -->
37
+
38
+
<divclass="tab-panel"id="node">
39
+
<h2class="language-title">node</h2>
40
+
41
+
{% capture m %}
42
+
43
+
By default the Node version of Pattern Lab deletes or overwrites most of the files and directories found in `public/` when generating your site or starting the watch. Developers are supposed to use `source/` to store their files. The build process and the copy task found in the [Gruntfile]() or [Gulpfile]() work in concert to move everything from `source/` to `public/`, including static assets like images, JavaScript and CSS. When generating your site the Node version of Pattern Lab moves all of the static assets found in `source/` to `public/` (_after cleaning it_) so there shouldn't be a reason not to use `source/`.
44
+
45
+
That said, developers might be more comfortable storing their static assets in `public/`. In order to turn-off the automatic overwriting of the `public/` directory:
46
+
47
+
If you use grunt...
48
+
49
+
1. Remove all or portions of the `copy` task from your gruntfile to stop overwriting of the assets you want to remain in `public/`
50
+
2. Inside `builder/patternlab_grunt.js`, change the flag inside calls to patternlab.build(true) and patternlab.build_patterns_only(true) to `false`.
51
+
52
+
If you use gulp...
53
+
54
+
1. Remove all or portions of the `cp:assettype` tasks from your gulpfile to stop overwriting of the assets you want to remain in `public/`, or alternatively alter the gulp tasks at the bottom of the gulpfile.
55
+
2. Remove the `clean` tasks as a prerequisite from all other tasks, both in the gulpfile and in `builder/patternlab-gulp.js`
56
+
57
+
When you next generate your site or start the watch `public/` will no longer be cleaned.
0 commit comments