How to use the awesome-typescript-loader.TsConfigPathsPlugin function in awesome-typescript-loader

To help you get started, we’ve selected a few awesome-typescript-loader 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 ng-select / ng-select / webpack.config.js View on Github external
config.output = {
        path: root('dist'),
        publicPath: isProd ? 'ng-select' : 'http://localhost:8080/',
        filename: isProd ? 'js/[name].[hash].js' : 'js/[name].js',
        chunkFilename: isProd ? '[id].[hash].chunk.js' : '[id].chunk.js'
    };

    /**
     * Resolve
     * Reference: http://webpack.github.io/docs/configuration.html#resolve
     */
    config.resolve = {
        // only discover files that have those extensions
        extensions: ['.ts', '.js', '.json', '.css', '.scss', '.html'],
        plugins: [
            new TsConfigPathsPlugin({
                configFileName: './demo/tsconfig.json',
                compiler: 'typescript'
            })
        ]
    };

    /**
     * Loaders
     * Reference: http://webpack.github.io/docs/configuration.html#module-loaders
     * List: http://webpack.github.io/docs/list-of-loaders.html
     * This handles most of the magic responsible for converting modules
     */
    config.module = {
        rules: [
            // Support for .ts files.
            {
github Shopify / polaris-react / config / webpack / config.js View on Github external
},
      'react-dom': {
        commonjs: 'react-dom',
        commonjs2: 'react',
        amd: 'react-dom',
        root: 'ReactDOM',
      },
    },
    plugins: [
      new webpack.NoEmitOnErrorsPlugin(),
      new webpack.LoaderOptionsPlugin({
        minimize: true,
        debug: false,
      }),

      new TsConfigPathsPlugin(),
      new CheckerPlugin(),
      new CaseSensitivePathsPlugin(),
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify('production'),
        },
      }),

      new webpack.optimize.UglifyJsPlugin({
        sourceMap: true,
        compress: {
          // eslint-disable-next-line camelcase
          screw_ie8: true,
          warnings: false,
        },
        mangle: {
github umijs / umi / packages / af-webpack / src / getConfig.js View on Github external
'.js',
        '.json',
        '.jsx',
        '.ts',
        '.tsx',
      ],
      alias: {
        '@babel/runtime': dirname(
          require.resolve('@babel/runtime/package.json'),
        ),
        ...opts.alias,
      },
      plugins:
        process.env.TS_CONFIG_PATHS_PLUGIN &&
        process.env.TS_CONFIG_PATHS_PLUGIN !== 'none'
          ? [new TsConfigPathsPlugin()]
          : [],
    },
    module: {
      rules: [
        ...(process.env.DISABLE_TSLINT || process.env.TSLINT === 'none'
          ? []
          : [
              {
                test: /\.tsx?$/,
                include: opts.cwd,
                exclude: /node_modules/,
                enforce: 'pre',
                use: [
                  {
                    options: {
                      emitErrors: true,
github ng-select / ng-select / scripts / webpack.dev.js View on Github external
devtool: isProd ? 'source-map' : 'eval-source-map',
        mode: isProd ? 'production' : 'development',
        entry: {
            'polyfills': './demo/polyfills.ts',
            'app': './demo/main.ts',
        },
        output: {
            path: root('dist'),
            publicPath: isProd ? 'ng-select' : 'http://localhost:8080/',
            filename: isProd ? 'js/[name].[hash].js' : 'js/[name].js',
            chunkFilename: isProd ? '[id].[hash].chunk.js' : '[id].chunk.js'
        },
        resolve: {
            extensions: ['.ts', '.js', '.json', '.css', '.scss', '.html'],
            plugins: [
                new TsConfigPathsPlugin({
                    configFileName: './demo/tsconfig.json',
                    compiler: 'typescript'
                })
            ]
        },
        module: {
            rules: [
                {
                    test: /\.ts$/,
                    loader: ['awesome-typescript-loader?configFileName=./demo/tsconfig.json', 'angular2-template-loader', 'ng-snippets-loader'],
                    exclude: [/\.(spec|e2e)\.ts$/, /node_modules\/(?!(ng2-.+))/],
                },

                {
                    test: /\.ts$/,
                    enforce: 'pre',
github ng-vcl / ng-vcl / webpack.config.demo.js View on Github external
}]),
      isProd ? new UglifyJsPlugin({
        mangle: {
          screw_ie8 : true,
        }, //prod
        compress: {  //prod
          screw_ie8: true,
          warnings: false
        },
        sourceMap: true,
        comments: false //prod
      }) : null
    ].filter(plugin=>plugin!==null),
    resolve: {
      extensions: ['.ts', '.js', '.json'],
      plugins: [ new TsConfigPathsPlugin() ]
    },
    devServer: {
      contentBase: './app/public',
      host: '0.0.0.0',
      port: PORT,
      hot: HMR,
      inline: HMR,
      historyApiFallback: true
    },
    node: {
      global: true,
      process: true,
      Buffer: false,
      crypto: 'empty',
      module: false,
      clearImmediate: false,
github matvp91 / indigo-player / webpack.config.js View on Github external
},
            {
              test: /\.(png|jp(e*)g)$/,
              use: {
                loader: 'url-loader',
                options: {
                  limit: 8000,
                },
              },
            },
          ],
        },
        resolve: {
          extensions: ['.tsx', '.ts', '.js'],
          plugins: [
            new TsConfigPathsPlugin(),
          ],
        },
        plugins: [
          new webpack.DefinePlugin({
            VERSION: JSON.stringify(pkg.version),
          }),
          new webpack.BannerPlugin(`indigo-player v${pkg.version} - [name] - ${+new Date()}`),
        ],
        optimization: {
          splitChunks: {
            chunks: 'async',
            cacheGroups: {
              vendors: false,
            },
          },
          minimizer: [],

awesome-typescript-loader

Awesome TS loader for webpack

MIT
Latest version published 6 years ago

Package Health Score

55 / 100
Full package analysis