pom.xml插件配置

 <plugin>
                <!-- https://mvnrepository.com/artifact/com.github.eirslett/frontend-maven-plugin -->
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>install node and npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>v6.11.1</nodeVersion>
                            <npmVersion>3.10.10</npmVersion>
                        </configuration>
                    </execution>
                     <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>install</arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm run dev</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run dev</arguments>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <installDirectory>/var/temp</installDirectory>
                    <workingDirectory>web</workingDirectory>
                </configuration>
            </plugin>

项目paths.js配置

// config after eject: we're in ./config/
module.exports = {
  dotenv: resolveApp('.env'),
  appBuild: resolveApp('打包的位置'),
  appPublic: resolveApp('打包的位置'),
  appHtml: resolveApp('public/index.html'),
  appIndexJs: resolveApp('src/index.js'),
  appPackageJson: resolveApp('package.json'),
  appSrc: resolveApp('src'),
  yarnLockFile: resolveApp('yarn.lock'),
  testsSetup: resolveApp('src/setupTests.js'),
  appNodeModules: resolveApp('node_modules'),
  publicUrl: getPublicUrl(resolveApp('package.json')),
  servedPath: getServedPath(resolveApp('package.json')),
};

webpack.config.prod.js配置

plugins: [
  new webpack.DllReferencePlugin({
    context: __dirname,
    manifest: require('../dll/vendor-manifest.json'),
  }),
  new CopyWebpackPlugin([
    {from: path.resolve(__dirname,'../dll'),
      to:path.resolve(__dirname,'打包的相对位置')}
  ]),
Logo

前往低代码交流专区

更多推荐