Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'../../test-runner.sketchplugin/Contents/Sketch'
)
// https://webpack.js.org/configuration/output/#output-devtoolmodulefilenametemplate
config.output.devtoolModuleFilenameTemplate = '[absolute-resource-path]'
config.plugins.push(
new webpack.ProvidePlugin({
expect: require.resolve('../../expect'),
})
)
if (!argv.buildOnly) {
config.plugins.push(
// eslint-disable-next-line
new WebpackTestRunner({
script: sketchtoolRunCommand(
path.resolve(__dirname, '../../test-runner.sketchplugin'),
'plugin-tests',
{
app: argv.app,
withoutActivating: true,
handleError: false,
}
),
watching: argv.watch,
getTestFiles,
logProgress,
})
)
}
config.plugins.push({
async function runPlugin (json, callback) {
fs.writeFileSync(jsonPath, json);
const command = sketchtoolRunCommand(
path.resolve(__dirname, '../plugin', 'asketch2sketch.sketchplugin'),
'run',
{ context: { jsonPath } }
);
exec(command, (error, stdout) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
callback(stdout.trim());
});
}
const webpack = require('webpack')
const path = require('path')
const generateWebpackConfig = require('@skpm/builder').webpackConfig
generateWebpackConfig(
{},
path.join(process.cwd(), './.scripts'),
path.join(process.cwd(), './.scripts'),
{}
)({
isPluginCommand: true,
script: path.basename(process.argv[2]),
absolutePath: process.argv[2],
handlers: ['onRun'],
})
.then(webpackConfig => {
const compiler = webpack(webpackConfig)
return compiler.run((err, res) => {
if (err) {
console.error(err)
const path = require('path')
const webpack = require('webpack')
const babelLoader = require('@skpm/builder/lib/utils/babelLoader').default({})
const PRODUCTION = process.env.NODE_ENV !== 'development'
const OUTPUT_PATH = path.resolve(__dirname, './build')
const ENTRIES = [
{ entry: './Source/index.ts', output: 'SketchAPI.js' },
{ entry: './Source/async/index.ts', output: 'SketchAPI_async.js' },
{
entry: './Source/data-supplier/index.ts',
output: 'SketchAPI_data-supplier.js',
},
{ entry: './Source/dom/index.js', output: 'SketchAPI_dom.js' },
{ entry: './Source/settings/index.ts', output: 'SketchAPI_settings.js' },
{ entry: './Source/ui/index.ts', output: 'SketchAPI_ui.js' },
]