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

feat: sync from base-source by sync-branch #2

Merged
merged 3 commits into from
Sep 9, 2020
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
10 changes: 0 additions & 10 deletions config/dist-packaging/amp/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions config/dist-packaging/amp/worker/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions config/dist-packaging/debug/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions config/dist-packaging/debug/worker/package.json

This file was deleted.

6 changes: 0 additions & 6 deletions config/dist-packaging/worker/package.json

This file was deleted.

42 changes: 24 additions & 18 deletions config/rollup.main-thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import compiler from '@ampproject/rollup-plugin-closure-compiler';
import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';
import copy from 'rollup-plugin-copy';
import { babelPlugin, removeDebugCommandExecutors, removeWorkerWhitespace } from './rollup.plugins.js';

const ESModules = [
Expand Down Expand Up @@ -51,14 +50,6 @@ const ESModules = [
},
plugins: [
removeWorkerWhitespace(),
copy({
targets: [
{
src: 'config/dist-packaging/debug/package.json',
dest: 'dist/debug',
},
],
}),
replace({
WORKER_DOM_DEBUG: true,
}),
Expand All @@ -71,20 +62,35 @@ const ESModules = [
{
input: 'output/main-thread/index.amp.js',
output: {
file: 'dist/amp/main.mjs',
file: 'dist/amp-production/main.mjs',
format: 'es',
sourcemap: true,
banner: 'var WORKER_DOM_DEBUG = /log|development/i.test(location.hash);',
},
plugins: [
removeWorkerWhitespace(),
copy({
targets: [
{
src: 'config/dist-packaging/amp/package.json',
dest: 'dist/amp',
},
],
removeDebugCommandExecutors(),
replace({
WORKER_DOM_DEBUG: false,
}),
babelPlugin({
transpileToES5: false,
allowConsole: false,
}),
compiler(),
terser(),
],
},
{
input: 'output/main-thread/index.amp.js',
output: {
file: 'dist/amp-debug/main.mjs',
format: 'es',
sourcemap: true,
},
plugins: [
removeWorkerWhitespace(),
replace({
WORKER_DOM_DEBUG: true,
}),
babelPlugin({
transpileToES5: false,
Expand Down
138 changes: 84 additions & 54 deletions config/rollup.worker-thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import compiler from '@ampproject/rollup-plugin-closure-compiler';
import { terser } from 'rollup-plugin-terser';
import replace from '@rollup/plugin-replace';
import copy from 'rollup-plugin-copy';
import { babelPlugin } from './rollup.plugins.js';

// Compile plugins should always be added at the end of the plugin list.
Expand All @@ -41,14 +40,6 @@ const ESModules = [
sourcemap: true,
},
plugins: [
copy({
targets: [
{
src: 'config/dist-packaging/worker/package.json',
dest: 'dist/worker',
},
],
}),
replace({
WORKER_DOM_DEBUG: false,
}),
Expand All @@ -68,14 +59,6 @@ const ESModules = [
sourcemap: true,
},
plugins: [
copy({
targets: [
{
src: 'config/dist-packaging/debug/worker/package.json',
dest: 'dist/debug/worker',
},
],
}),
replace({
WORKER_DOM_DEBUG: true,
}),
Expand All @@ -88,21 +71,31 @@ const ESModules = [
{
input: 'output/worker-thread/index.amp.js',
output: {
file: 'dist/amp/worker/worker.mjs',
file: 'dist/amp-production/worker/worker.mjs',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
banner: 'var WORKER_DOM_DEBUG = /log|development/i.test(location.hash);',
},
plugins: [
copy({
targets: [
{
src: 'config/dist-packaging/amp/worker/package.json',
dest: 'dist/amp/worker',
},
],
replace({
WORKER_DOM_DEBUG: false,
}),
babelPlugin({
transpileToES5: false,
allowConsole: false,
}),
...compilePlugins,
],
},
{
input: 'output/worker-thread/index.amp.js',
output: {
file: 'dist/amp-debug/worker/worker.mjs',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
},
plugins: [
babelPlugin({
transpileToES5: false,
allowConsole: true,
Expand All @@ -112,45 +105,70 @@ const ESModules = [
{
input: 'output/worker-thread/index.amp.js',
output: {
file: 'dist/amp/worker/worker.js',
file: 'dist/amp-production/worker/worker.js',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
},
plugins: [
replace({
WORKER_DOM_DEBUG: false,
}),
babelPlugin({
transpileToES5: true,
allowConsole: false,
}),
...compilePlugins,
],
},
{
input: 'output/worker-thread/index.amp.js',
output: {
file: 'dist/amp-debug/worker/worker.js',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
banner: 'var WORKER_DOM_DEBUG = /log|development/i.test(location.hash);',
},
plugins: [
copy({
targets: [
{
src: 'config/dist-packaging/amp/worker/package.json',
dest: 'dist/amp/worker',
},
],
replace({
WORKER_DOM_DEBUG: true,
}),
babelPlugin({
transpileToES5: true,
allowConsole: true,
}),
],
},
{
input: 'output/worker-thread/index.nodom.amp.js',
output: {
file: 'dist/amp-production/worker/worker.nodom.mjs',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
},
plugins: [
replace({
WORKER_DOM_DEBUG: false,
}),
babelPlugin({
transpileToES5: false,
allowConsole: true,
}),
...compilePlugins,
],
},
{
input: 'output/worker-thread/index.nodom.amp.js',
output: {
file: 'dist/amp/worker/worker.nodom.mjs',
file: 'dist/amp-debug/worker/worker.nodom.mjs',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
banner: 'var WORKER_DOM_DEBUG = /log|development/i.test(location.hash);',
},
plugins: [
copy({
targets: [
{
src: 'config/dist-packaging/amp/worker/package.json',
dest: 'dist/amp/worker',
},
],
replace({
WORKER_DOM_DEBUG: true,
}),
babelPlugin({
transpileToES5: false,
Expand All @@ -161,28 +179,40 @@ const ESModules = [
{
input: 'output/worker-thread/index.nodom.amp.js',
output: {
file: 'dist/amp/worker/worker.nodom.js',
file: 'dist/amp-production/worker/worker.nodom.js',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
banner: 'var WORKER_DOM_DEBUG = /log|development/i.test(location.hash);',
},
plugins: [
copy({
targets: [
{
src: 'config/dist-packaging/amp/worker/package.json',
dest: 'dist/amp/worker',
},
],
replace({
WORKER_DOM_DEBUG: false,
}),
babelPlugin({
transpileToES5: true,
allowConsole: true,
allowConsole: false,
}),
...compilePlugins,
],
},
{
input: 'output/worker-thread/index.nodom.amp.js',
output: {
file: 'dist/amp-debug/worker/worker.nodom.js',
format: 'iife',
name: 'WorkerThread',
sourcemap: true,
},
plugins: [
replace({
WORKER_DOM_DEBUG: true,
}),
babelPlugin({
transpileToES5: true,
allowConsole: true,
}),
],
},
];

const IIFEModules = [
Expand Down
14 changes: 7 additions & 7 deletions demo/preact-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
},
"dependencies": {
"obj-str": "1.0.3",
"preact": "10.4.4"
"preact": "10.4.8"
},
"devDependencies": {
"@babel/core": "7.10.2",
"@babel/preset-env": "7.10.2",
"@babel/plugin-transform-react-jsx": "7.10.1",
"babel-loader": "8.1.0",
"css-loader": "3.5.3",
"mini-css-extract-plugin": "0.9.0",
"css-loader": "4.3.0",
"mini-css-extract-plugin": "0.11.1",
"style-loader": "1.2.1",
"webpack": "4.43.0",
"webpack-cli": "3.3.11"
"webpack": "4.44.1",
"webpack-cli": "3.3.12"
},
"volta": {
"node": "14.4.0",
"yarn": "1.22.4"
"node": "14.10.0",
"yarn": "1.22.5"
}
}
12 changes: 6 additions & 6 deletions demo/react-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"@babel/preset-env": "7.10.2",
"@babel/plugin-transform-react-jsx": "7.10.1",
"babel-loader": "8.1.0",
"css-loader": "3.5.3",
"mini-css-extract-plugin": "0.9.0",
"css-loader": "4.3.0",
"mini-css-extract-plugin": "0.11.1",
"style-loader": "1.2.1",
"webpack": "4.43.0",
"webpack-cli": "3.3.11"
"webpack": "4.44.1",
"webpack-cli": "3.3.12"
},
"volta": {
"node": "14.4.0",
"yarn": "1.22.4"
"node": "14.10.0",
"yarn": "1.22.5"
}
}
Loading