Skip to content

Commit 91256b4

Browse files
authored
Merge pull request #414 from stasm/fluent-gecko-react
fluent-gecko: Add fluent-react.js build target
2 parents bb3b961 + 31fe57e commit 91256b4

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

fluent-gecko/makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include ../common.mk
66
version = $(1)@$(shell node -e "\
77
console.log(require('../$(1)/package.json').version)")
88

9-
build: Fluent.jsm FluentSyntax.jsm Localization.jsm DOMLocalization.jsm l10n.js
9+
build: Fluent.jsm FluentSyntax.jsm Localization.jsm DOMLocalization.jsm l10n.js fluent-react.js
1010

1111
Fluent.jsm: $(SOURCES)
1212
@rollup $(CURDIR)/src/fluent.js \
@@ -44,6 +44,13 @@ l10n.js: $(SOURCES)
4444
--output.file ./dist/$@
4545
@echo -e " $(OK) $@ built"
4646

47+
fluent-react.js: $(SOURCES)
48+
@rollup $(CURDIR)/src/fluent-react.js \
49+
--config ./vendor_config.js \
50+
--output.intro "/* $(call version,fluent-react) */" \
51+
--output.file ./dist/$@
52+
@echo -e " $(OK) $@ built"
53+
4754
clean:
4855
@rm -rf dist
4956
@rm -rf .nyc_output coverage

fluent-gecko/src/fluent-react.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "../../fluent-react/src/index.js";

fluent-gecko/vendor_config.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import nodeResolve from 'rollup-plugin-node-resolve';
2+
import bundleConfig from '../bundle_config';
3+
4+
export default Object.assign({}, bundleConfig, {
5+
context: 'this',
6+
output: {
7+
format: 'cjs',
8+
preferConst: true,
9+
banner: `\
10+
/* Copyright 2019 Mozilla Foundation and others
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License");
13+
* you may not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS,
20+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
`,
26+
},
27+
external: [
28+
"react",
29+
"prop-types"
30+
],
31+
plugins: [
32+
nodeResolve(),
33+
]
34+
});

0 commit comments

Comments
 (0)