This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webdriver from 'selenium-webdriver'; | |
import firefox from 'selenium-webdriver/firefox'; | |
const XPI_PATH = ... // xpi file path | |
const firefoxOption = new firefox.Options(); | |
firefoxOption.setPreference('xpinstall.signatures.required', false); | |
firefoxOption.setBinary(firefox.Channel.AURORA); // Set Developer Edition | |
const driver = new webdriver.Builder() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webdriver from 'selenium-webdriver'; | |
import { Driver, Options } from 'selenium-webdriver/chrome'; | |
const CRX_PATH = // YOUR_LOCAL_CRX_PATH | |
const options = new Options(); | |
options.addExtensions(CRX_PATH); | |
const driver = Driver.createSession(options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webdriver from 'selenium-webdriver'; | |
import { Driver, Options } from 'selenium-webdriver/chrome'; | |
const EXT_PATH = //YOUR_LOCAL_EXTENSION_PATH | |
const chromeOptions = { args: [`load-extension=${EXT_PATH}`] }; | |
const driver = new webdriver.Builder() | |
.withCapabilities({ chromeOptions }) | |
.build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulpJsonTransform from 'gulp-json-transform'; | |
function patchChunks() { | |
return gulp.src(path.resolve(config.output.path, 'manifest.json')) | |
.pipe(gulpJsonTransform((data) => { | |
data.background.scripts = ... | |
data.content_scripts = .... | |
// ... | |
return data; | |
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"background": { | |
"scripts": [ | |
"js/background.d2faff93.js" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulpWebpack from 'webpack-stream'; | |
import config from './config/webpack.prod.config'; | |
function webpack() { | |
return gulp.src(Object.values(config.entry)) | |
.pipe(gulpWebpack({ config }, null, (err, stats) => { | |
stats.compilation.chunks.forEach(({ files: assets, name }) => { | |
// name is chunk name | |
// assets is chunk file name | |
// persist them here! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new UglifyJSPlugin({ | |
uglifyOptions: { | |
toplevel: true, | |
mangle: { | |
properties: { | |
regex: /REGEXS/ | |
} | |
} | |
}, | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/AllenFang/lerna-tutorial-example.git | |
cd lerna-tutorial-example | |
cp ~/.ssh/id_rsa.pub ./docker/git-server/keys | |
cp ~/.ssh/id_rsa ./docker/git-server/keys | |
cd docker | |
docker-compose up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function patchManifest(done) { | |
const tasks = countryList.map((countryName) => { | |
function patchManifestByCountry() { | |
return | |
gulp.src(`./build/${countryName}/manifest.json`) | |
.pipe(gulpJsonTransform((data) => { | |
data.homepage_url = .....; | |
return data; | |
})) | |
.pipe(gulp.dest(`./build/${countryName}/`)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulp from 'gulp'; | |
import gulpJsonTransform from 'gulp-json-transform'; | |
import countryList from './config/countries'; // it's an array of string | |
// omit clean, distribute etc | |
function patchManifest(done) { | |
const tasks = countryList.map((countryName) => { | |
// Right here, we return a function per country | |
return () => |
NewerOlder