How to use @skpm/builder - 4 common examples

To help you get started, we’ve selected a few @skpm/builder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github skpm / skpm / packages / test-runner / lib / utils / update-webpack-config.js View on Github external
'../../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({
github KimDal-hyeong / html-to-sketch-electron / script / runPlugin.js View on Github external
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());
  });
}
github skpm / sketch-dev-tools / assets / build-script.js View on Github external
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)
github sketch-hq / SketchAPI / webpack.config.js View on Github external
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' },
]

@skpm/builder

A script to build and link sketch plugins

MIT
Latest version published 1 year ago

Package Health Score

49 / 100
Full package analysis